/** * Lazy init the dynamic SQL mechanism. */ protected DynamicSQLBatchWritingMechanism getDynamicSQLMechanism() { if (this.dynamicSQLMechanism == null) { this.dynamicSQLMechanism = new DynamicSQLBatchWritingMechanism(this); } return this.dynamicSQLMechanism; }
/** * INTERNAL: * This method is used by the DatabaseAccessor to execute and clear the batched statements in the * case that a non batchable statement is being executed */ public void executeBatchedStatements(AbstractSession session) { if (this.sqlStrings.isEmpty()) { return; } //Bug#419326 : Added below clone, clear and clone.executeBatch(session) //Cloning the mechanism and clearing the current mechanism ensures that the current batch //is not visible to recursive calls to executeBatchedStatements(session). DynamicSQLBatchWritingMechanism currentBatch = (DynamicSQLBatchWritingMechanism) this.clone(); this.clear(); currentBatch.executeBatch(session); }
if (!dbCall.hasParameters()) { if ((this.batchSize + dbCall.getSQLString().length()) > this.maxBatchSize) { executeBatchedStatements(session); executeBatchedStatements(session); cacheQueryTimeout(session, dbCall); executeBatchedStatements(session); executeBatchedStatements(session); switchMechanisms(session, dbCall);
this.databaseAccessor.incrementCallCount(session);// Decrement occurs in close. if (!session.getPlatform().usesJDBCBatchWriting()) { PreparedStatement statement = prepareBatchStatement(session); this.databaseAccessor.executeBatchedStatement(statement, session); } else { Statement statement = prepareJDK12BatchStatement(session); this.databaseAccessor.executeJDK12BatchStatement(statement, null, session, false); this.clear();
if (!dbCall.hasParameters()) { if ((this.batchSize + dbCall.getSQLString().length()) > this.maxBatchSize) { executeBatchedStatements(session); executeBatchedStatements(session); cacheQueryTimeout(session, dbCall); executeBatchedStatements(session); executeBatchedStatements(session); switchMechanisms(session, dbCall);
clear(); PreparedStatement statement = prepareBatchStatement(session); this.databaseAccessor.executeBatchedStatement(statement, session); } else { Statement statement = prepareJDK12BatchStatement(session); this.executionCount = this.databaseAccessor.executeJDK12BatchStatement(statement, null, session, false); if (this.usesOptimisticLocking && (executionCount != statementCount)) { clear();
cacheQueryTimeout(session, dbCall); executeBatchedStatements(session); executeBatchedStatements(session); executeBatchedStatements(session); this.switchMechanisms(session, dbCall);
clear(); PreparedStatement statement = prepareBatchStatement(session); this.databaseAccessor.executeBatchedStatement(statement, session); } else { Statement statement = prepareJDK12BatchStatement(session); this.executionCount = this.databaseAccessor.executeJDK12BatchStatement(statement, null, session, false); if (this.usesOptimisticLocking && (executionCount != statementCount)) { clear();
/** * INTERNAL: * This method is used by the DatabaseAccessor to execute and clear the batched statements in the * case that a non batchable statement is being executed */ public void executeBatchedStatements(AbstractSession session) { if (this.sqlStrings.isEmpty()) { return; } //Bug#419326 : Added below clone, clear and clone.executeBatch(session) //Cloning the mechanism and clearing the current mechanism ensures that the current batch //is not visible to recursive calls to executeBatchedStatements(session). DynamicSQLBatchWritingMechanism currentBatch = (DynamicSQLBatchWritingMechanism) this.clone(); this.clear(); currentBatch.executeBatch(session); }
/** * Lazy init the dynamic SQL mechanism. */ protected DynamicSQLBatchWritingMechanism getDynamicSQLMechanism() { if (this.dynamicSQLMechanism == null) { this.dynamicSQLMechanism = new DynamicSQLBatchWritingMechanism(this); } return this.dynamicSQLMechanism; }
/** * Lazy init the dynamic SQL mechanism. */ protected DynamicSQLBatchWritingMechanism getDynamicSQLMechanism() { if (this.dynamicSQLMechanism == null) { this.dynamicSQLMechanism = new DynamicSQLBatchWritingMechanism(this); } return this.dynamicSQLMechanism; }