use of org.h2.engine.Mode in project ignite by apache.
the class H2Utils method setupConnection.
/**
* @param conn Connection to use.
* @param qctx Query context.
* @param distributedJoins If distributed joins are enabled.
* @param enforceJoinOrder Enforce join order of tables.
* @param lazy Lazy query execution mode.
*/
public static void setupConnection(H2PooledConnection conn, QueryContext qctx, boolean distributedJoins, boolean enforceJoinOrder, boolean lazy) {
Session s = session(conn);
s.setForceJoinOrder(enforceJoinOrder);
s.setJoinBatchEnabled(distributedJoins);
s.setLazyQueryExecution(lazy);
QueryContext oldCtx = (QueryContext) s.getVariable(QCTX_VARIABLE_NAME).getObject();
assert oldCtx == null || oldCtx == qctx : oldCtx;
s.setVariable(QCTX_VARIABLE_NAME, new ValueRuntimeSimpleObject<>(qctx));
// Hack with thread local context is used only for H2 methods that is called without Session object.
// e.g. GridH2Table.getRowCountApproximation (used only on optimization phase, after parse).
QueryContext.threadLocal(qctx);
}
Aggregations