catch (Exception e)
{
log.log(Level.FINEST, "Query execution error", e);
if (queryContext != null)
{
throw new QueryInvocationException(e, queryContext);
}
throw new QueryInvocationException(e, proxy.getClass(), method);
}
finally
{
context.dispose();
}