if (listener != null) {
try {
- QueryCacheBase.resultAsyncReadEntry(newGraph, request, null, listener, procedure);
- } catch (DatabaseException e) {
- Logger.defaultLogError(e);
- }
+ QueryCacheBase.resultAsyncReadEntry(newGraph, request, null, listener, procedure);
+ } catch (DatabaseException e) {
+ LOGGER.error("Unhandled query exception", e);
+ }
} else {
- BlockingAsyncProcedure<T> wrap = new BlockingAsyncProcedure<T>(newGraph, null, procedure, request, true) {
-
- public void execute(AsyncReadGraph graph_, T result) {
- task.finish();
- super.execute(graph_, result);
- }
-
- public void exception(AsyncReadGraph graph_, Throwable t) {
- task.finish();
- super.exception(graph_, t);
- }
-
- };
-
- try {
+ BlockingAsyncProcedure<T> wrap = new BlockingAsyncProcedure<T>(newGraph, null, procedure, request, true) {
- request.perform(newGraph, wrap);
- wrap.dec();
- wrap.get();
+ public void execute(AsyncReadGraph graph_, T result) {
+ task.finish();
+ super.execute(graph_, result);
+ }
- } catch (DatabaseException e) {
+ public void exception(AsyncReadGraph graph_, Throwable t) {
+ task.finish();
+ super.exception(graph_, t);
+ }
- Logger.defaultLogError(e);
+ };
+ try {
+ wrap.performSync(request);
+ } catch (DatabaseException e) {
+ LOGGER.error("Unhandled query exception", e);
}
}