Class DbSqlSession

    • Field Detail

      • JDBC_METADATA_TABLE_TYPES

        public static final java.lang.String[] JDBC_METADATA_TABLE_TYPES
      • PG_JDBC_METADATA_TABLE_TYPES

        public static final java.lang.String[] PG_JDBC_METADATA_TABLE_TYPES
      • sqlSession

        protected org.apache.ibatis.session.SqlSession sqlSession
      • connectionMetadataDefaultCatalog

        protected java.lang.String connectionMetadataDefaultCatalog
      • connectionMetadataDefaultSchema

        protected java.lang.String connectionMetadataDefaultSchema
    • Constructor Detail

      • DbSqlSession

        public DbSqlSession​(DbSqlSessionFactory dbSqlSessionFactory,
                            java.sql.Connection connection,
                            java.lang.String catalog,
                            java.lang.String schema)
    • Method Detail

      • selectList

        public java.util.List<?> selectList​(java.lang.String statement,
                                            java.lang.Object parameter)
      • executeSelectList

        public java.util.List<java.lang.Object> executeSelectList​(java.lang.String statement,
                                                                  java.lang.Object parameter)
      • selectById

        public <T extends DbEntity> T selectById​(java.lang.Class<T> type,
                                                 java.lang.String id)
      • selectOne

        public java.lang.Object selectOne​(java.lang.String statement,
                                          java.lang.Object parameter)
      • lock

        public void lock​(java.lang.String statement,
                         java.lang.Object parameter)
      • executeSelectForUpdate

        protected abstract void executeSelectForUpdate​(java.lang.String statement,
                                                       java.lang.Object parameter)
      • entityUpdatePerformed

        protected void entityUpdatePerformed​(DbEntityOperation operation,
                                             int rowsAffected,
                                             org.apache.ibatis.exceptions.PersistenceException failure)
      • bulkUpdatePerformed

        protected void bulkUpdatePerformed​(DbBulkOperation operation,
                                           int rowsAffected,
                                           org.apache.ibatis.exceptions.PersistenceException failure)
      • bulkDeletePerformed

        protected void bulkDeletePerformed​(DbBulkOperation operation,
                                           int rowsAffected,
                                           org.apache.ibatis.exceptions.PersistenceException failure)
      • bulkOperationPerformed

        protected void bulkOperationPerformed​(DbBulkOperation operation,
                                              int rowsAffected,
                                              org.apache.ibatis.exceptions.PersistenceException failure)
      • entityDeletePerformed

        protected void entityDeletePerformed​(DbEntityOperation operation,
                                             int rowsAffected,
                                             org.apache.ibatis.exceptions.PersistenceException failure)
      • configureFailedDbEntityOperation

        protected void configureFailedDbEntityOperation​(DbEntityOperation operation,
                                                        org.apache.ibatis.exceptions.PersistenceException failure)
      • isConcurrentModificationException

        protected boolean isConcurrentModificationException​(DbOperation failedOperation,
                                                            org.apache.ibatis.exceptions.PersistenceException cause)
      • isCrdbConcurrencyConflict

        public static boolean isCrdbConcurrencyConflict​(java.lang.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.
        Parameters:
        cause - for which an operation failed
        Returns:
        true if the failure was due to a CRDB TransactionRetryException. Otherwise, it's false.
      • isCrdbConcurrencyConflictOnCommit

        public static boolean isCrdbConcurrencyConflictOnCommit​(java.lang.Exception 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. 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.
        Parameters:
        cause - for which an operation failed
        configuration - of the Process Engine
        Returns:
        true if the failure was due to a CRDB TransactionRetryException. Otherwise, it's false.
      • executeInsertEntity

        protected void executeInsertEntity​(java.lang.String insertStatement,
                                           java.lang.Object parameter)
      • entityInsertPerformed

        protected void entityInsertPerformed​(DbEntityOperation operation,
                                             int rowsAffected,
                                             org.apache.ibatis.exceptions.PersistenceException failure)
      • executeDelete

        protected int executeDelete​(java.lang.String deleteStatement,
                                    java.lang.Object parameter)
      • executeUpdate

        public int executeUpdate​(java.lang.String updateStatement,
                                 java.lang.Object parameter)
      • update

        public int update​(java.lang.String updateStatement,
                          java.lang.Object parameter)
      • executeNonEmptyUpdateStmt

        public int executeNonEmptyUpdateStmt​(java.lang.String updateStmt,
                                             java.lang.Object parameter)
      • flush

        public void flush()
      • flushOperations

        public void flushOperations()
      • flushBatchOperations

        public java.util.List<org.apache.ibatis.executor.BatchResult> flushBatchOperations()
      • close

        public void close()
      • commit

        public void commit()
      • rollback

        public void rollback()
      • dbSchemaCheckVersion

        public void dbSchemaCheckVersion()
      • executeMandatorySchemaResource

        public void executeMandatorySchemaResource​(java.lang.String operation,
                                                   java.lang.String component)
      • isTablePresent

        public boolean isTablePresent​(java.lang.String tableName)
      • getTablesPresentInOracleDatabase

        protected java.util.List<java.lang.String> getTablesPresentInOracleDatabase()
                                                                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • prependDatabaseTablePrefix

        public java.lang.String prependDatabaseTablePrefix​(java.lang.String tableName)
      • getResourceForDbOperation

        public java.lang.String getResourceForDbOperation​(java.lang.String directory,
                                                          java.lang.String operation,
                                                          java.lang.String component)
      • executeSchemaResource

        public void executeSchemaResource​(java.lang.String operation,
                                          java.lang.String component,
                                          java.lang.String resourceName,
                                          boolean isOptional)
      • executeSchemaResource

        public void executeSchemaResource​(java.lang.String schemaFileResourceName)
      • addSqlStatementPiece

        protected java.lang.String addSqlStatementPiece​(java.lang.String sqlStatement,
                                                        java.lang.String line)
      • readNextTrimmedLine

        protected java.lang.String readNextTrimmedLine​(java.io.BufferedReader reader)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • isMissingTablesException

        protected boolean isMissingTablesException​(java.lang.Exception e)
      • getTableTypes

        protected java.lang.String[] getTableTypes()
      • getSqlSession

        public org.apache.ibatis.session.SqlSession getSqlSession()