/** * INTERNAL: * Swaps out the Mechanism for the other Mechanism */ protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) { this.databaseAccessor.setActiveBatchWritingMechanismToDynamicSQL(); this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall); }
/** * Rollback a transaction on the database. This means toggling the auto-commit option. */ @Override public void rollbackTransaction(AbstractSession session) throws DatabaseException { getActiveBatchWritingMechanism(session).clear(); super.rollbackTransaction(session); }
/** * This method will be called after a series of writes have been issued to * mark where a particular set of writes has completed. It will be called * from commitTransaction and may be called from writeChanges. Its main * purpose is to ensure that the batched statements have been executed */ @Override public void writesCompleted(AbstractSession session) { if (isConnected && isInBatchWritingMode(session)) { getActiveBatchWritingMechanism(session).executeBatchedStatements(session); } } }
/** * INTERNAL: * This method is used internally to return the active batch writing mechanism to batch the statement */ public BatchWritingMechanism getActiveBatchWritingMechanism(AbstractSession session) { if (this.activeBatchWritingMechanism == null) { // If the platform defines a custom mechanism, then use it. if (((DatabasePlatform)this.platform).getBatchWritingMechanism() != null) { this.activeBatchWritingMechanism = ((DatabasePlatform)this.platform).getBatchWritingMechanism().clone(); this.activeBatchWritingMechanism.setAccessor(this, session); } else { this.activeBatchWritingMechanism = getParameterizedMechanism(); } } return this.activeBatchWritingMechanism; }
getActiveBatchWritingMechanism(session).appendCall(session, dbCall); getActiveBatchWritingMechanism(session).executeBatchedStatements(session);
/** * Clone the accessor. */ @Override public Object clone() { DatabaseAccessor accessor = (DatabaseAccessor)super.clone(); accessor.dynamicSQLMechanism = null; if (this.activeBatchWritingMechanism != null) { accessor.activeBatchWritingMechanism = this.activeBatchWritingMechanism.clone(); } accessor.parameterizedMechanism = null; accessor.statementCache = null; return accessor; }
getPlatform().getBatchWritingMechanism().initialize(this);
&& (!dbCall.shouldBuildOutputRow()) && (getPlatform().usesJDBCBatchWriting() || (!dbCall.hasParameters())) && (!dbCall.isLOBLocatorNeeded())) { getActiveBatchWritingMechanism().appendCall(session, dbCall); getActiveBatchWritingMechanism().executeBatchedStatements(session);
/** * INTERNAL: * This method is used internally to return the active batch writing mechanism to batch the statement */ public BatchWritingMechanism getActiveBatchWritingMechanism(AbstractSession session) { if (this.activeBatchWritingMechanism == null) { // If the platform defines a custom mechanism, then use it. if (((DatabasePlatform)this.platform).getBatchWritingMechanism() != null) { this.activeBatchWritingMechanism = ((DatabasePlatform)this.platform).getBatchWritingMechanism().clone(); this.activeBatchWritingMechanism.setAccessor(this, session); } else { this.activeBatchWritingMechanism = getParameterizedMechanism(); } } return this.activeBatchWritingMechanism; }
/** * Clone the accessor. */ @Override public Object clone() { DatabaseAccessor accessor = (DatabaseAccessor)super.clone(); accessor.dynamicSQLMechanism = null; if (this.activeBatchWritingMechanism != null) { accessor.activeBatchWritingMechanism = this.activeBatchWritingMechanism.clone(); } accessor.parameterizedMechanism = null; accessor.statementCache = null; return accessor; }
getPlatform().getBatchWritingMechanism().initialize(this);
getActiveBatchWritingMechanism(session).appendCall(session, dbCall); getActiveBatchWritingMechanism(session).executeBatchedStatements(session);
/** * INTERNAL: * This method is used to switch from this mechanism to the alternate automatically */ protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) { this.databaseAccessor.setActiveBatchWritingMechanismToParameterizedSQL(); this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall); }
/** * This method will be called after a series of writes have been issued to * mark where a particular set of writes has completed. It will be called * from commitTransaction and may be called from writeChanges. Its main * purpose is to ensure that the batched statements have been executed */ public void writesCompleted(AbstractSession session) { if (isConnected && isInBatchWritingMode(session)) { getActiveBatchWritingMechanism(session).executeBatchedStatements(session); } }
/** * Rollback a transaction on the database. This means toggling the auto-commit option. */ public void rollbackTransaction(AbstractSession session) throws DatabaseException { getActiveBatchWritingMechanism().clear(); super.rollbackTransaction(session); }
/** * INTERNAL: * Swaps out the Mechanism for the other Mechanism */ protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) { this.databaseAccessor.setActiveBatchWritingMechanismToDynamicSQL(); this.databaseAccessor.getActiveBatchWritingMechanism(session).appendCall(session, dbCall); }
/** * This method will be called after a series of writes have been issued to * mark where a particular set of writes has completed. It will be called * from commitTransaction and may be called from writeChanges. Its main * purpose is to ensure that the batched statements have been executed */ public void writesCompleted(AbstractSession session) { if (isInBatchWritingMode(session)) { getActiveBatchWritingMechanism().executeBatchedStatements(session); } } }
/** * Rollback a transaction on the database. This means toggling the auto-commit option. */ public void rollbackTransaction(AbstractSession session) throws DatabaseException { getActiveBatchWritingMechanism(session).clear(); super.rollbackTransaction(session); }
/** * INTERNAL: * This method is used to switch from this mechanism to the alternate automatically */ protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) { this.databaseAccessor.setActiveBatchWritingMechanismToParameterizedSQL(); this.databaseAccessor.getActiveBatchWritingMechanism().appendCall(session, dbCall); }
/** * INTERNAL: * Swaps out the Mechanism for the other Mechanism */ protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) { this.databaseAccessor.setActiveBatchWritingMechanismToDynamicSQL(); this.databaseAccessor.getActiveBatchWritingMechanism().appendCall(session, dbCall); }