public abstract class DbSqlSession extends AbstractPersistenceSession
Modifier and Type | Field and Description |
---|---|
protected String |
connectionMetadataDefaultCatalog |
protected String |
connectionMetadataDefaultSchema |
protected DbSqlSessionFactory |
dbSqlSessionFactory |
static String[] |
JDBC_METADATA_TABLE_TYPES |
protected static EnginePersistenceLogger |
LOG |
static String[] |
PG_JDBC_METADATA_TABLE_TYPES |
protected org.apache.ibatis.session.SqlSession |
sqlSession |
listeners
Constructor and Description |
---|
DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory) |
DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory,
Connection connection,
String catalog,
String schema) |
Modifier and Type | Method and Description |
---|---|
protected String |
addSqlStatementPiece(String sqlStatement,
String line) |
protected void |
bulkDeletePerformed(DbBulkOperation operation,
int rowsAffected,
Exception failure) |
protected void |
bulkOperationPerformed(DbBulkOperation operation,
int rowsAffected,
Exception failure) |
protected void |
bulkUpdatePerformed(DbBulkOperation operation,
int rowsAffected,
Exception failure) |
void |
close() |
void |
commit() |
protected void |
configureFailedDbEntityOperation(DbEntityOperation operation,
Exception failure) |
void |
dbSchemaCheckVersion() |
protected void |
dbSchemaCreateCmmn() |
protected void |
dbSchemaCreateCmmnHistory() |
protected void |
dbSchemaCreateDmn() |
protected void |
dbSchemaCreateDmnHistory() |
protected void |
dbSchemaCreateEngine() |
protected void |
dbSchemaCreateHistory() |
protected void |
dbSchemaCreateIdentity() |
protected void |
dbSchemaDropCmmn() |
protected void |
dbSchemaDropCmmnHistory() |
protected void |
dbSchemaDropDmn() |
protected void |
dbSchemaDropDmnHistory() |
protected void |
dbSchemaDropEngine() |
protected void |
dbSchemaDropHistory() |
protected void |
dbSchemaDropIdentity() |
protected void |
entityDeletePerformed(DbEntityOperation operation,
int rowsAffected,
Exception failure) |
protected void |
entityInsertPerformed(DbEntityOperation operation,
int rowsAffected,
Exception failure) |
protected void |
entityUpdatePerformed(DbEntityOperation operation,
int rowsAffected,
Exception failure) |
protected int |
executeDelete(String deleteStatement,
Object parameter) |
protected void |
executeInsertEntity(String insertStatement,
Object parameter) |
void |
executeMandatorySchemaResource(String operation,
String component) |
int |
executeNonEmptyUpdateStmt(String updateStmt,
Object parameter) |
void |
executeSchemaResource(String schemaFileResourceName) |
void |
executeSchemaResource(String operation,
String component,
String resourceName,
boolean isOptional) |
protected abstract void |
executeSelectForUpdate(String statement,
Object parameter) |
List<Object> |
executeSelectList(String statement,
Object parameter) |
int |
executeUpdate(String updateStatement,
Object parameter) |
void |
flush() |
List<org.apache.ibatis.executor.BatchResult> |
flushBatchOperations() |
void |
flushOperations() |
DbSqlSessionFactory |
getDbSqlSessionFactory() |
protected String |
getDbVersion() |
String |
getResourceForDbOperation(String directory,
String operation,
String component) |
org.apache.ibatis.session.SqlSession |
getSqlSession() |
List<String> |
getTableNamesPresent() |
protected List<String> |
getTablesPresentInOracleDatabase() |
protected String[] |
getTableTypes() |
protected void |
insertEntity(DbEntityOperation operation) |
boolean |
isCmmnHistoryTablePresent() |
boolean |
isCmmnTablePresent() |
protected boolean |
isConcurrentModificationException(DbOperation failedOperation,
Exception cause) |
static boolean |
isCrdbConcurrencyConflict(Throwable cause)
In cases where CockroachDB is used, and a failed operation is detected,
the method checks if the exception was caused by a CockroachDB
TransactionRetryException . |
static boolean |
isCrdbConcurrencyConflictOnCommit(Throwable cause,
ProcessEngineConfigurationImpl configuration)
In cases where CockroachDB is used, and a failed operation is detected,
the method checks if the exception was caused by a CockroachDB
TransactionRetryException . |
boolean |
isDmnHistoryTablePresent() |
boolean |
isDmnTablePresent() |
boolean |
isEngineTablePresent() |
boolean |
isHistoryTablePresent() |
boolean |
isIdentityTablePresent() |
protected boolean |
isMissingTablesException(Exception e) |
boolean |
isTablePresent(String tableName) |
void |
lock(String statement,
Object parameter) |
String |
prependDatabaseTablePrefix(String tableName) |
protected String |
readNextTrimmedLine(BufferedReader reader) |
void |
rollback() |
<T extends DbEntity> |
selectById(Class<T> type,
String id) |
List<?> |
selectList(String statement,
Object parameter) |
Object |
selectOne(String statement,
Object parameter) |
int |
update(String updateStatement,
Object parameter) |
addEntityLoadListener, dbSchemaCreate, dbSchemaDrop, dbSchemaPrune, dbSchemaUpdate, deleteBulk, deleteEntity, executeDbOperation, fireEntityLoaded, updateBulk, updateEntity
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
executeDbOperations
protected static final EnginePersistenceLogger LOG
public static final String[] JDBC_METADATA_TABLE_TYPES
public static final String[] PG_JDBC_METADATA_TABLE_TYPES
protected org.apache.ibatis.session.SqlSession sqlSession
protected DbSqlSessionFactory dbSqlSessionFactory
protected String connectionMetadataDefaultCatalog
protected String connectionMetadataDefaultSchema
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory)
public DbSqlSession(DbSqlSessionFactory dbSqlSessionFactory, Connection connection, String catalog, String schema)
protected abstract void executeSelectForUpdate(String statement, Object parameter)
protected void entityUpdatePerformed(DbEntityOperation operation, int rowsAffected, Exception failure)
protected void bulkUpdatePerformed(DbBulkOperation operation, int rowsAffected, Exception failure)
protected void bulkDeletePerformed(DbBulkOperation operation, int rowsAffected, Exception failure)
protected void bulkOperationPerformed(DbBulkOperation operation, int rowsAffected, Exception failure)
protected void entityDeletePerformed(DbEntityOperation operation, int rowsAffected, Exception failure)
protected void configureFailedDbEntityOperation(DbEntityOperation operation, Exception failure)
protected boolean isConcurrentModificationException(DbOperation failedOperation, Exception cause)
public static boolean isCrdbConcurrencyConflict(Throwable cause)
TransactionRetryException
.cause
- for which an operation failedTransactionRetryException
.
Otherwise, it's false.public static boolean isCrdbConcurrencyConflictOnCommit(Throwable cause, ProcessEngineConfigurationImpl configuration)
TransactionRetryException
. This method may be used when a
CRDB Error occurs on commit, and a Command Context is not available, as
it has already been closed. This is the case with Spring/JTA transaction
interceptors.cause
- for which an operation failedconfiguration
- of the Process EngineTransactionRetryException
.
Otherwise, it's false.protected void insertEntity(DbEntityOperation operation)
insertEntity
in class AbstractPersistenceSession
protected void entityInsertPerformed(DbEntityOperation operation, int rowsAffected, Exception failure)
public void flush()
public void flushOperations()
public List<org.apache.ibatis.executor.BatchResult> flushBatchOperations()
public void close()
public void commit()
public void rollback()
public void dbSchemaCheckVersion()
protected String getDbVersion()
getDbVersion
in class AbstractPersistenceSession
protected void dbSchemaCreateIdentity()
dbSchemaCreateIdentity
in class AbstractPersistenceSession
protected void dbSchemaCreateHistory()
dbSchemaCreateHistory
in class AbstractPersistenceSession
protected void dbSchemaCreateEngine()
dbSchemaCreateEngine
in class AbstractPersistenceSession
protected void dbSchemaCreateCmmn()
dbSchemaCreateCmmn
in class AbstractPersistenceSession
protected void dbSchemaCreateCmmnHistory()
dbSchemaCreateCmmnHistory
in class AbstractPersistenceSession
protected void dbSchemaCreateDmn()
dbSchemaCreateDmn
in class AbstractPersistenceSession
protected void dbSchemaCreateDmnHistory()
dbSchemaCreateDmnHistory
in class AbstractPersistenceSession
protected void dbSchemaDropIdentity()
dbSchemaDropIdentity
in class AbstractPersistenceSession
protected void dbSchemaDropHistory()
dbSchemaDropHistory
in class AbstractPersistenceSession
protected void dbSchemaDropEngine()
dbSchemaDropEngine
in class AbstractPersistenceSession
protected void dbSchemaDropCmmn()
dbSchemaDropCmmn
in class AbstractPersistenceSession
protected void dbSchemaDropCmmnHistory()
dbSchemaDropCmmnHistory
in class AbstractPersistenceSession
protected void dbSchemaDropDmn()
dbSchemaDropDmn
in class AbstractPersistenceSession
protected void dbSchemaDropDmnHistory()
dbSchemaDropDmnHistory
in class AbstractPersistenceSession
public void executeMandatorySchemaResource(String operation, String component)
public boolean isEngineTablePresent()
isEngineTablePresent
in class AbstractPersistenceSession
public boolean isHistoryTablePresent()
isHistoryTablePresent
in class AbstractPersistenceSession
public boolean isIdentityTablePresent()
isIdentityTablePresent
in class AbstractPersistenceSession
public boolean isCmmnTablePresent()
isCmmnTablePresent
in class AbstractPersistenceSession
public boolean isCmmnHistoryTablePresent()
isCmmnHistoryTablePresent
in class AbstractPersistenceSession
public boolean isDmnTablePresent()
isDmnTablePresent
in class AbstractPersistenceSession
public boolean isDmnHistoryTablePresent()
isDmnHistoryTablePresent
in class AbstractPersistenceSession
public boolean isTablePresent(String tableName)
public List<String> getTableNamesPresent()
getTableNamesPresent
in interface PersistenceSession
getTableNamesPresent
in class AbstractPersistenceSession
protected List<String> getTablesPresentInOracleDatabase() throws SQLException
SQLException
public String getResourceForDbOperation(String directory, String operation, String component)
public void executeSchemaResource(String operation, String component, String resourceName, boolean isOptional)
public void executeSchemaResource(String schemaFileResourceName)
protected String readNextTrimmedLine(BufferedReader reader) throws IOException
IOException
protected boolean isMissingTablesException(Exception e)
protected String[] getTableTypes()
public org.apache.ibatis.session.SqlSession getSqlSession()
public DbSqlSessionFactory getDbSqlSessionFactory()
Copyright © 2022. All rights reserved.