}
private CypherResult doExecuteQuery(String query, Map<String, Object> params, boolean canProfile) {
params = params == null ? Collections.<String,Object>emptyMap() : params;
long time=System.currentTimeMillis();
Transaction tx = gdb.beginTx();
javax.transaction.Transaction resumeTx;
try {
resumeTx = suspendTx(query);
ExecutionResult result = canProfile ? executionEngine.profile(query,params) : executionEngine.execute(query,params);
final Collection<Map<String, Object>> data = IteratorUtil.asCollection(result);
time = System.currentTimeMillis() - time;
resumeTransaction(resumeTx);
CypherResult cypherResult = new CypherResult(result.columns(), data, result.getQueryStatistics(), time, canProfile ? result.executionPlanDescription() : null, prettify(query));
tx.success();
return cypherResult;
} finally {
tx.close();
awaitIndexOnline(query);
}
}