Class BatchDbSqlSession
java.lang.Object
org.camunda.bpm.engine.impl.db.AbstractPersistenceSession
org.camunda.bpm.engine.impl.db.sql.DbSqlSession
org.camunda.bpm.engine.impl.db.sql.BatchDbSqlSession
- All Implemented Interfaces:
PersistenceSession,Session
For mybatis
ExecutorType.BATCH-
Field Summary
Fields inherited from class org.camunda.bpm.engine.impl.db.sql.DbSqlSession
connectionMetadataDefaultCatalog, connectionMetadataDefaultSchema, dbSqlSessionFactory, JDBC_METADATA_TABLE_TYPES, LOG, PG_JDBC_METADATA_TABLE_TYPES, sqlSessionFields inherited from class org.camunda.bpm.engine.impl.db.AbstractPersistenceSession
listeners -
Constructor Summary
ConstructorsConstructorDescriptionBatchDbSqlSession(DbSqlSessionFactory dbSqlSessionFactory) BatchDbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, Connection connection, String catalog, String schema) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddeleteBulk(DbBulkOperation operation) protected voiddeleteEntity(DbEntityOperation operation) executeDbOperations(List<DbOperation> operations) Attempts to perform the operations in order and returns a flush result.protected voidexecuteSelectForUpdate(String statement, Object parameter) protected FlushResultpostProcessBatchFailure(List<DbOperation> operations, org.apache.ibatis.exceptions.PersistenceException exception) protected FlushResultpostProcessBatchSuccess(List<DbOperation> operations, List<org.apache.ibatis.executor.BatchResult> batchResults) protected voidpostProcessJdbcBatchResult(Iterator<DbOperation> operationsIt, int[] statementResults, org.apache.ibatis.exceptions.PersistenceException failure, List<DbOperation> failedOperations) This method can be called with three cases: Case 1: Success.protected voidpostProcessOperationPerformed(DbOperation operation, int rowsAffected, org.apache.ibatis.exceptions.PersistenceException failure) protected booleanrequiresAffectedRows(DbOperationType operationType) protected voidupdateBulk(DbBulkOperation operation) protected voidupdateEntity(DbEntityOperation operation) Methods inherited from class org.camunda.bpm.engine.impl.db.sql.DbSqlSession
addSqlStatementPiece, bulkDeletePerformed, bulkOperationPerformed, bulkUpdatePerformed, close, commit, configureFailedDbEntityOperation, dbSchemaCheckVersion, dbSchemaCreateCmmn, dbSchemaCreateCmmnHistory, dbSchemaCreateDmn, dbSchemaCreateDmnHistory, dbSchemaCreateEngine, dbSchemaCreateHistory, dbSchemaCreateIdentity, dbSchemaDropCmmn, dbSchemaDropCmmnHistory, dbSchemaDropDmn, dbSchemaDropDmnHistory, dbSchemaDropEngine, dbSchemaDropHistory, dbSchemaDropIdentity, entityDeletePerformed, entityInsertPerformed, entityUpdatePerformed, executeDelete, executeInsertEntity, executeMandatorySchemaResource, executeNonEmptyUpdateStmt, executeSchemaResource, executeSchemaResource, executeSelectList, executeUpdate, flush, flushBatchOperations, flushOperations, getDbSqlSessionFactory, getDbVersion, getResourceForDbOperation, getSqlSession, getTableNamesPresent, getTablesPresentInOracleDatabase, getTableTypes, insertEntity, isCmmnHistoryTablePresent, isCmmnTablePresent, isConcurrentModificationException, isDmnHistoryTablePresent, isDmnTablePresent, isEngineTablePresent, isHistoryTablePresent, isIdentityTablePresent, isMissingTablesException, isTablePresent, lock, prependDatabaseTablePrefix, readNextTrimmedLine, rollback, selectById, selectList, selectOne, updateMethods inherited from class org.camunda.bpm.engine.impl.db.AbstractPersistenceSession
addEntityLoadListener, dbSchemaCreate, dbSchemaDrop, dbSchemaPrune, dbSchemaUpdate, executeDbOperation, fireEntityLoaded
-
Constructor Details
-
BatchDbSqlSession
-
BatchDbSqlSession
public BatchDbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, Connection connection, String catalog, String schema)
-
-
Method Details
-
executeDbOperations
Description copied from interface:PersistenceSessionAttempts to perform the operations in order and returns a flush result. The result indicates if there are operations that were not successful (via
FlushResult.getFailedOperations()and if some operations were not executed (viaFlushResult.getRemainingOperations(). The remaining operations must be a suffix of the parameter (e.g. for operations [a, b, c, d], [c, d] is a valid list of remaining operations, [b, c] is not).This method modifies the operation's state, i.e.
DbOperation.getState()will be updated by calling this method:- Successful operations:
DbOperation.State.APPLIED - Failed operations:
DbOperation.State.FAILED_ERRORorDbOperation.State.FAILED_CONCURRENT_MODIFICATION. - Remaining operations:
DbOperation.State.NOT_APPLIED
- Successful operations:
-
postProcessBatchSuccess
protected FlushResult postProcessBatchSuccess(List<DbOperation> operations, List<org.apache.ibatis.executor.BatchResult> batchResults) -
postProcessBatchFailure
protected FlushResult postProcessBatchFailure(List<DbOperation> operations, org.apache.ibatis.exceptions.PersistenceException exception) -
postProcessJdbcBatchResult
protected void postProcessJdbcBatchResult(Iterator<DbOperation> operationsIt, int[] statementResults, org.apache.ibatis.exceptions.PersistenceException failure, List<DbOperation> failedOperations) This method can be called with three cases:
- Case 1: Success. statementResults contains the number of affected rows for all operations.
- Case 2: Failure. statementResults contains the number of affected rows for all successful operations that were executed before the failed operation.
- Case 3: Failure. statementResults contains the number of affected rows for all operations of the batch, i.e. further statements were executed after the first failed statement.
See
BatchUpdateException.getUpdateCounts()for the specification of cases 2 and 3. -
requiresAffectedRows
-
postProcessOperationPerformed
protected void postProcessOperationPerformed(DbOperation operation, int rowsAffected, org.apache.ibatis.exceptions.PersistenceException failure) -
updateEntity
- Specified by:
updateEntityin classAbstractPersistenceSession
-
updateBulk
- Specified by:
updateBulkin classAbstractPersistenceSession
-
deleteBulk
- Specified by:
deleteBulkin classAbstractPersistenceSession
-
deleteEntity
- Specified by:
deleteEntityin classAbstractPersistenceSession
-
executeSelectForUpdate
- Specified by:
executeSelectForUpdatein classDbSqlSession
-