Class DatabaseConnection

  • All Implemented Interfaces:
    TriggerListener

    public class DatabaseConnection
    extends java.lang.Object
    implements TriggerListener
    An object that represents a connection to a Database. This object handles all transactional queries and modifications to the database.
    Author:
    Tobias Downer
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  DatabaseConnection.CallBack
      Call back interface for events that occur within the connection instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCheckConstraint​(TableName table_name, Expression expression, short deferred, java.lang.String constraint_name)
      Same as the Transaction.addCheckConstraint method.
      void addForeignKeyConstraint​(TableName table, java.lang.String[] cols, TableName ref_table, java.lang.String[] ref_cols, java.lang.String delete_rule, java.lang.String update_rule, short deferred, java.lang.String constraint_name)
      Same as the Transaction.addForeignKeyConstraint method.
      void addPrimaryKeyConstraint​(TableName table_name, java.lang.String[] cols, short deferred, java.lang.String constraint_name)
      Same as the Transaction.addPrimaryKeyConstraint method.
      void addSelectedFromTable​(TableName name)
      Adds the given table name to the list of tables that are selected from within the transaction in this connection.
      void addSelectedFromTable​(java.lang.String table_name)
      Adds the given table name to the list of tables that are selected from within the transaction in this connection.
      void addUniqueConstraint​(TableName table_name, java.lang.String[] cols, short deferred, java.lang.String constraint_name)
      Same as the Transaction.addUniqueConstraint method.
      void alterCreateTable​(DataTableDef table_def)
      Given a DataTableDef, if the table exists then it is updated otherwise if it doesn't exist then it is created.
      void alterCreateTable​(DataTableDef table_def, int data_sector_size, int index_sector_size)
      Given a DataTableDef, if the table exists then it is updated otherwise if it doesn't exist then it is created.
      void checkAllConstraints​(TableName table_name)
      Checks all the rows in the table for immediate constraint violations and when the transaction is next committed check for all deferred constraint violations.
      void close()
      Closes this database connection.
      void commit()
      Tries to commit the current transaction.
      void compactTable​(TableName table_name)
      Compacts the table with the given name.
      void compactTable​(java.lang.String table_name)
      Compacts the table with the given name.
      Ref createNewLargeObject​(byte type, long object_size)
      Allocates a new large object in the Blob store of this conglomerate of the given type and size.
      QueryPlanNode createObjectFetchQueryPlan​(TableName table_name, TableName aliased_name)
      Creates a QueryPlanNode to fetch the given table object from this connection.
      void createSchema​(java.lang.String name, java.lang.String type)
      Same as the Transaction.createSchema method.
      void createSequenceGenerator​(TableName name, long start_value, long increment_by, long min_value, long max_value, long cache, boolean cycle)
      Creates a new sequence generator with the given TableName and initializes it with the given details.
      void createTable​(DataTableDef table_def)
      Create a new table within the context of the current connection transaction.
      void createTable​(DataTableDef table_def, int data_sector_size, int index_sector_size)
      Create a new table with a starting initial sector size.
      void createTrigger​(java.lang.String trigger_name, java.lang.String trigger_source, int type)
      Adds a type of trigger for the given trigger source (usually the name of the table).
      void createView​(SQLQuery query, ViewDef view)
      Creates a new view.
      DebugLogger Debug()
      Returns a DebugLogger object that we can use to log debug messages to.
      void deleteTrigger​(java.lang.String trigger_name)
      Removes a type of trigger for the given trigger source (usually the name of the table).
      void dropAllConstraintsForTable​(TableName table_name)
      Same as the Transaction.dropAllConstraintsForTable method.
      int dropNamedConstraint​(TableName table_name, java.lang.String constraint_name)
      Same as the Transaction.dropNamedConstraint method.
      boolean dropPrimaryKeyConstraintForTable​(TableName table_name, java.lang.String constraint_name)
      Same as the Transaction.dropPrimaryKeyConstraintForTable method.
      void dropSchema​(java.lang.String name)
      Same as the Transaction.dropSchema method.
      void dropSequenceGenerator​(TableName name)
      Drops an existing sequence generator with the given name.
      void dropTable​(TableName table_name)
      Drops a table from within the context of the current connection transaction.
      void dropTable​(java.lang.String table_name)
      Drops a table from within the context of the current connection transaction.
      boolean dropView​(TableName view_name)
      Drops the view with the given name and returns true if the drop succeeded.
      void finalize()  
      void fireTrigger​(DatabaseConnection database, java.lang.String trigger_name, TriggerEvent evt)
      Notifies when a trigger has fired for this user.
      void flushBlobStore()
      Tells the conglomerate to flush the blob store.
      boolean getAutoCommit()
      Returns the auto-commit status of this connection.
      ConnectionTriggerManager getConnectionTriggerManager()
      Returns the connection trigger manager for this connection.
      java.lang.String getCurrentSchema()
      Returns the name of the schema that this connection is within.
      Database getDatabase()
      Returns the Database object for this connection.
      DataTableDef getDataTableDef​(TableName name)
      Returns the DataTableDef for the table with the given name.
      GrantManager getGrantManager()
      Returns the GrantManager object that manages grants for tables in the database for this connection/user.
      java.sql.Connection getJDBCConnection()
      Returns a java.sql.Connection object that can be used as a JDBC interface to access the current transaction of this DatabaseConnection.
      LockingMechanism getLockingMechanism()
      Returns the LockingMechanism object that is within the context of this database connection.
      java.lang.String getPersistentVar​(java.lang.String variable)
      Same as the Transaction.getPersistentVar method.
      ProcedureManager getProcedureManager()
      Returns the ProcedureManager object that manages database functions and procedures in the database for this connection/user.
      SchemaDef[] getSchemaList()
      Same as the Transaction.getSchemaList method.
      DatabaseSystem getSystem()
      Returns the DatabaseSystem object for this connection.
      DataTable getTable​(TableName name)
      Returns a DataTable that represents the table from the given schema, name in the database.
      DataTable getTable​(java.lang.String table_name)
      Returns a DataTable that represents the table with the given name in the database from the current connection schema.
      TableName[] getTableList()
      Returns a TableName[] array that contains the list of database tables that are visible by this transaction.
      TableQueryDef getTableQueryDef​(TableName table_name, TableName aliased_as)
      Returns a TableQueryDef object that describes the characteristics of a table including the name (TableName), the columns (DataTableDef) and the query plan to produce the table (QueryPlanNode).
      java.lang.String getTableType​(TableName table_name)
      Returns the type of the table object.
      int getTransactionIsolation()
      Returns the transaction isolation level of this connection.
      java.lang.String getTransactionIsolationAsString()
      Returns the transaction isolation level of this connection as a string.
      User getUser()
      Returns the User object for this connection.
      boolean isInCaseInsensitiveMode()
      Returns true if the connection is in case insensitive mode.
      long lastSequenceValue​(java.lang.String name)
      Returns the current sequence value for the given sequence generator that was last returned by a call to 'nextSequenceValue'.
      long nextSequenceValue​(java.lang.String name)
      Requests of the sequence generator the next value from the sequence.
      long nextUniqueID​(TableName name)
      Returns the next unique identifier for the given table from the schema.
      long nextUniqueID​(java.lang.String table_name)
      Returns the next unique identifier for the given table in the connection schema.
      void notifyTriggerEvent​(TriggerEvent evt)
      Informs the underlying transaction that a high level transaction event has occurred and should be dispatched to any listeners occordingly.
      Transaction.CheckExpression[] queryTableCheckExpressions​(TableName table_name)
      Same as the Transaction.queryTableCheckExpression method.
      Transaction.ColumnGroupReference[] queryTableForeignKeyReferences​(TableName table_name)
      Same as the Transaction.queryTableForeignKeyReferences method.
      Transaction.ColumnGroupReference[] queryTableImportedForeignKeyReferences​(TableName table_name)
      Same as the Transaction.queryTableImportedForeignKeyReferences method.
      Transaction.ColumnGroup queryTablePrimaryKeyGroup​(TableName table_name)
      Same as the Transaction.queryTablePrimaryKeyGroup method.
      TableName[] queryTablesRelationallyLinkedTo​(TableName table)
      Same as the Transaction.queryTablesRelationallyLinkedTo method.
      Transaction.ColumnGroup[] queryTableUniqueGroups​(TableName table_name)
      Same as the Transaction.queryTableUniqueGroups method.
      SchemaDef resolveSchemaCase​(java.lang.String name, boolean ignore_case)
      Same as the Transaction.resolveSchemaCase method.
      SchemaDef resolveSchemaName​(java.lang.String name)
      Convenience - returns the SchemaDef object given the name of the schema.
      TableName resolveTableName​(java.lang.String name)
      Resolves a TableName string (eg.
      TableName resolveToTableName​(java.lang.String name)
      Resolves the given string to a table name, throwing an exception if the reference is ambiguous.
      void rollback()
      Rolls back the current transaction operating within this connection.
      boolean schemaExists​(java.lang.String name)
      Same as the Transaction.schemaExists method.
      void setAutoCommit​(boolean status)
      Sets the auto-commit mode.
      void setCurrentSchema​(java.lang.String current_schema)
      Sets the schema that this connection is within.
      void setDefaultSchema​(java.lang.String schema_name)
      Changes the default schema to the given schema.
      void setPersistentVar​(java.lang.String variable, java.lang.String value)
      Same as the Transaction.setPersistentVar method.
      void setSequenceValue​(java.lang.String name, long value)
      Sets the sequence value for the given sequence generator.
      void setTransactionIsolation​(java.lang.String name)
      Sets the transaction isolation level from a string.
      void setVar​(java.lang.String name, Expression exp)
      Assigns a variable to the expression for this connection.
      boolean tableExists​(TableName table_name)
      Returns true if the table exists within this connection transaction.
      boolean tableExists​(java.lang.String table_name)
      Returns true if the table exists within this connection transaction.
      TableName tryResolveCase​(TableName table_name)
      Attempts to resolve the given table name to its correct case assuming the table name represents a case insensitive version of the name.
      void updateTable​(DataTableDef table_def)
      Updates a given table within the context of the current connection transaction.
      void updateTable​(DataTableDef table_def, int data_sector_size, int index_sector_size)
      Updates a given table within the context of the current connection transaction.
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getJDBCConnection

        public java.sql.Connection getJDBCConnection()
        Returns a java.sql.Connection object that can be used as a JDBC interface to access the current transaction of this DatabaseConnection.

        There are a few important considerations when using the JDBC connection;

        • The returned Connection does not allow auto-commit to be set. It is intended to be used to issue commands to this DatabaseConnection from inside a transaction so auto-commit does not make sense.
        • The returned object must only be accessed from the same worker thread that is currently accessing this DatabaseConnection. The returned Connection is NOT multi-thread capable.
        • The java.sql.Connection returned here is invalidated (disposed) when the current transaction is closed (committed or rolled back).
        • This method returns the same java.sql.Connection on multiple calls to this method (while a transaction is open).
        • The DatabaseConnection must be locked in EXCLUSIVE mode or the queries will fail.
      • getSystem

        public DatabaseSystem getSystem()
        Returns the DatabaseSystem object for this connection.
      • getDatabase

        public Database getDatabase()
        Returns the Database object for this connection.
      • getUser

        public User getUser()
        Returns the User object for this connection.
      • Debug

        public final DebugLogger Debug()
        Returns a DebugLogger object that we can use to log debug messages to.
      • getConnectionTriggerManager

        public ConnectionTriggerManager getConnectionTriggerManager()
        Returns the connection trigger manager for this connection.
      • getGrantManager

        public GrantManager getGrantManager()
        Returns the GrantManager object that manages grants for tables in the database for this connection/user.
      • getProcedureManager

        public ProcedureManager getProcedureManager()
        Returns the ProcedureManager object that manages database functions and procedures in the database for this connection/user.
      • setAutoCommit

        public void setAutoCommit​(boolean status)
        Sets the auto-commit mode.
      • setTransactionIsolation

        public void setTransactionIsolation​(java.lang.String name)
        Sets the transaction isolation level from a string.
      • setVar

        public void setVar​(java.lang.String name,
                           Expression exp)
        Assigns a variable to the expression for this connection. This is a generic way of setting properties of the connection. Currently supported variables are;

        ERROR_ON_DIRTY_SELECT - set to Boolean.TRUE for turning this transaction conflict off on this connection. CASE_INSENSITIVE_IDENTIFIERS - Boolean.TRUE means the grammar becomes case insensitive for identifiers resolved by the grammar.

      • getAutoCommit

        public boolean getAutoCommit()
        Returns the auto-commit status of this connection. If this is true then the language layer must execute a COMMIT after every statement.
      • getTransactionIsolation

        public int getTransactionIsolation()
        Returns the transaction isolation level of this connection.
      • getTransactionIsolationAsString

        public java.lang.String getTransactionIsolationAsString()
        Returns the transaction isolation level of this connection as a string.
      • getCurrentSchema

        public java.lang.String getCurrentSchema()
        Returns the name of the schema that this connection is within.
      • isInCaseInsensitiveMode

        public boolean isInCaseInsensitiveMode()
        Returns true if the connection is in case insensitive mode. In case insensitive mode the case of identifier strings is not important.
      • setCurrentSchema

        public void setCurrentSchema​(java.lang.String current_schema)
        Sets the schema that this connection is within.
      • getLockingMechanism

        public LockingMechanism getLockingMechanism()
        Returns the LockingMechanism object that is within the context of this database connection. This manages read/write locking within this connection.
      • getTableList

        public TableName[] getTableList()
        Returns a TableName[] array that contains the list of database tables that are visible by this transaction.

        This returns the list of all objects that represent queriable tables in the database.

      • tableExists

        public boolean tableExists​(java.lang.String table_name)
        Returns true if the table exists within this connection transaction.
      • tableExists

        public boolean tableExists​(TableName table_name)
        Returns true if the table exists within this connection transaction.
      • getTableType

        public java.lang.String getTableType​(TableName table_name)
        Returns the type of the table object. Currently this is either "TABLE" or "VIEW".
      • tryResolveCase

        public TableName tryResolveCase​(TableName table_name)
        Attempts to resolve the given table name to its correct case assuming the table name represents a case insensitive version of the name. For example, "aPP.CuSTOMer" may resolve to "APP.Customer". If the table name can not resolve to a valid identifier it returns the input table name, therefore the actual presence of the table should always be checked by calling 'tableExists' after this method returns.
      • resolveTableName

        public TableName resolveTableName​(java.lang.String name)
        Resolves a TableName string (eg. 'Customer' 'APP.Customer' ) to a TableName object. If the schema part of the table name is not present then it is set to the current schema of the database connection. If the database is ignoring the case then this will correctly resolve the table to the cased version of the table name.
      • resolveToTableName

        public TableName resolveToTableName​(java.lang.String name)
        Resolves the given string to a table name, throwing an exception if the reference is ambiguous. This also generates an exception if the table object is not found.
      • getDataTableDef

        public DataTableDef getDataTableDef​(TableName name)
        Returns the DataTableDef for the table with the given name.
      • getTable

        public DataTable getTable​(TableName name)
        Returns a DataTable that represents the table from the given schema, name in the database.
      • getTable

        public DataTable getTable​(java.lang.String table_name)
        Returns a DataTable that represents the table with the given name in the database from the current connection schema.
      • createTable

        public void createTable​(DataTableDef table_def)
        Create a new table within the context of the current connection transaction.
      • createTable

        public void createTable​(DataTableDef table_def,
                                int data_sector_size,
                                int index_sector_size)
        Create a new table with a starting initial sector size. This should only be used as very fine grain optimization for creating tables. If in the future the underlying table model is changed so that the given 'sector_size' value is unapplicable, then the value will be ignored.
      • createView

        public void createView​(SQLQuery query,
                               ViewDef view)
        Creates a new view. This takes the information in the ViewDef object and adds it to the system view table.

        Note that this is a transactional operation. You need to commit for the view to be visible to other transactions.

      • dropView

        public boolean dropView​(TableName view_name)
        Drops the view with the given name and returns true if the drop succeeded. Returns false if the view was not found.

        Note that this is a transactional operation. You need to commit for the change to be visible to other transactions.

      • updateTable

        public void updateTable​(DataTableDef table_def)
        Updates a given table within the context of the current connection transaction.
      • updateTable

        public void updateTable​(DataTableDef table_def,
                                int data_sector_size,
                                int index_sector_size)
        Updates a given table within the context of the current connection transaction. This should only be used as very fine grain optimization for creating tables.If in the future the underlying table model is changed so that the given 'sector_size' value is unapplicable, then the value will be ignored.
      • alterCreateTable

        public void alterCreateTable​(DataTableDef table_def,
                                     int data_sector_size,
                                     int index_sector_size)
        Given a DataTableDef, if the table exists then it is updated otherwise if it doesn't exist then it is created.

        This should only be used as very fine grain optimization for creating/ altering tables. If in the future the underlying table model is changed so that the given 'sector_size' value is unapplicable, then the value will be ignored.

      • alterCreateTable

        public void alterCreateTable​(DataTableDef table_def)
        Given a DataTableDef, if the table exists then it is updated otherwise if it doesn't exist then it is created.
      • checkAllConstraints

        public void checkAllConstraints​(TableName table_name)
        Checks all the rows in the table for immediate constraint violations and when the transaction is next committed check for all deferred constraint violations. This method is used when the constraints on a table changes and we need to determine if any constraint violations occurred. To the constraint checking system, this is like adding all the rows to the given table.
      • dropTable

        public void dropTable​(java.lang.String table_name)
        Drops a table from within the context of the current connection transaction.
      • dropTable

        public void dropTable​(TableName table_name)
        Drops a table from within the context of the current connection transaction.
      • compactTable

        public void compactTable​(java.lang.String table_name)
        Compacts the table with the given name. Throws an exception if the table doesn't exist.
      • compactTable

        public void compactTable​(TableName table_name)
        Compacts the table with the given name. Throws an exception if the table doesn't exist.
      • addSelectedFromTable

        public void addSelectedFromTable​(java.lang.String table_name)
        Adds the given table name to the list of tables that are selected from within the transaction in this connection.
      • addSelectedFromTable

        public void addSelectedFromTable​(TableName name)
        Adds the given table name to the list of tables that are selected from within the transaction in this connection.
      • nextSequenceValue

        public long nextSequenceValue​(java.lang.String name)
        Requests of the sequence generator the next value from the sequence.

        NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.

      • lastSequenceValue

        public long lastSequenceValue​(java.lang.String name)
        Returns the current sequence value for the given sequence generator that was last returned by a call to 'nextSequenceValue'. If a value was not last returned by a call to 'nextSequenceValue' then a statement exception is generated.

        NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.

      • setSequenceValue

        public void setSequenceValue​(java.lang.String name,
                                     long value)
        Sets the sequence value for the given sequence generator. If the generator does not exist or it is not possible to set the value for the generator then an exception is generated.

        NOTE: This does NOT check that the user owning this connection has the correct privs to perform this operation.

      • nextUniqueID

        public long nextUniqueID​(TableName name)
        Returns the next unique identifier for the given table from the schema.
      • nextUniqueID

        public long nextUniqueID​(java.lang.String table_name)
        Returns the next unique identifier for the given table in the connection schema.
      • createSequenceGenerator

        public void createSequenceGenerator​(TableName name,
                                            long start_value,
                                            long increment_by,
                                            long min_value,
                                            long max_value,
                                            long cache,
                                            boolean cycle)
        Creates a new sequence generator with the given TableName and initializes it with the given details. This does NOT check if the given name clashes with an existing database object.
      • dropSequenceGenerator

        public void dropSequenceGenerator​(TableName name)
        Drops an existing sequence generator with the given name.
      • createTrigger

        public void createTrigger​(java.lang.String trigger_name,
                                  java.lang.String trigger_source,
                                  int type)
        Adds a type of trigger for the given trigger source (usually the name of the table).

        Adds a type of trigger to the given Table. When the event is fired, the UserCallBack method is notified of the event.

      • deleteTrigger

        public void deleteTrigger​(java.lang.String trigger_name)
        Removes a type of trigger for the given trigger source (usually the name of the table).
      • notifyTriggerEvent

        public void notifyTriggerEvent​(TriggerEvent evt)
        Informs the underlying transaction that a high level transaction event has occurred and should be dispatched to any listeners occordingly.
      • createNewLargeObject

        public Ref createNewLargeObject​(byte type,
                                        long object_size)
        Allocates a new large object in the Blob store of this conglomerate of the given type and size. The blob data must be written through the Ref after the large object is created. Once the data has been written the 'complete' method in Ref is called.

        Once a large object is created and written to, it may be allocated in one or more tables in the conglomerate.

      • flushBlobStore

        public void flushBlobStore()
        Tells the conglomerate to flush the blob store. This should be called after one or more blobs have been created and the data for the blob(s) are set. It is an important step to perform AFTER blobs have been written.

        If this is not called and the database closes (or crashes) before a flush occurs then the blob may not be recoverable.

      • getTableQueryDef

        public TableQueryDef getTableQueryDef​(TableName table_name,
                                              TableName aliased_as)
        Returns a TableQueryDef object that describes the characteristics of a table including the name (TableName), the columns (DataTableDef) and the query plan to produce the table (QueryPlanNode). This object can be used to resolve information about a particular table, and to evaluate the query plan to produce the table itself.

        This produces TableQueryDef objects for all table objects in the database including data tables and views.

        The 'aliased_as' parameter is used to overwrite the default name of the table object.

      • createObjectFetchQueryPlan

        public QueryPlanNode createObjectFetchQueryPlan​(TableName table_name,
                                                        TableName aliased_name)
        Creates a QueryPlanNode to fetch the given table object from this connection.
      • setDefaultSchema

        public void setDefaultSchema​(java.lang.String schema_name)
        Changes the default schema to the given schema.
      • createSchema

        public void createSchema​(java.lang.String name,
                                 java.lang.String type)
        Same as the Transaction.createSchema method.
      • dropSchema

        public void dropSchema​(java.lang.String name)
        Same as the Transaction.dropSchema method.
      • schemaExists

        public boolean schemaExists​(java.lang.String name)
        Same as the Transaction.schemaExists method.
      • resolveSchemaCase

        public SchemaDef resolveSchemaCase​(java.lang.String name,
                                           boolean ignore_case)
        Same as the Transaction.resolveSchemaCase method.
      • resolveSchemaName

        public SchemaDef resolveSchemaName​(java.lang.String name)
        Convenience - returns the SchemaDef object given the name of the schema. If identifiers are case insensitive, we resolve the case of the schema name also.
      • getSchemaList

        public SchemaDef[] getSchemaList()
        Same as the Transaction.getSchemaList method.
      • setPersistentVar

        public void setPersistentVar​(java.lang.String variable,
                                     java.lang.String value)
        Same as the Transaction.setPersistentVar method.
      • getPersistentVar

        public java.lang.String getPersistentVar​(java.lang.String variable)
        Same as the Transaction.getPersistentVar method.
      • addUniqueConstraint

        public void addUniqueConstraint​(TableName table_name,
                                        java.lang.String[] cols,
                                        short deferred,
                                        java.lang.String constraint_name)
        Same as the Transaction.addUniqueConstraint method.
      • addForeignKeyConstraint

        public void addForeignKeyConstraint​(TableName table,
                                            java.lang.String[] cols,
                                            TableName ref_table,
                                            java.lang.String[] ref_cols,
                                            java.lang.String delete_rule,
                                            java.lang.String update_rule,
                                            short deferred,
                                            java.lang.String constraint_name)
        Same as the Transaction.addForeignKeyConstraint method.
      • addPrimaryKeyConstraint

        public void addPrimaryKeyConstraint​(TableName table_name,
                                            java.lang.String[] cols,
                                            short deferred,
                                            java.lang.String constraint_name)
        Same as the Transaction.addPrimaryKeyConstraint method.
      • addCheckConstraint

        public void addCheckConstraint​(TableName table_name,
                                       Expression expression,
                                       short deferred,
                                       java.lang.String constraint_name)
        Same as the Transaction.addCheckConstraint method.
      • dropAllConstraintsForTable

        public void dropAllConstraintsForTable​(TableName table_name)
        Same as the Transaction.dropAllConstraintsForTable method.
      • dropNamedConstraint

        public int dropNamedConstraint​(TableName table_name,
                                       java.lang.String constraint_name)
        Same as the Transaction.dropNamedConstraint method.
      • dropPrimaryKeyConstraintForTable

        public boolean dropPrimaryKeyConstraintForTable​(TableName table_name,
                                                        java.lang.String constraint_name)
        Same as the Transaction.dropPrimaryKeyConstraintForTable method.
      • queryTablesRelationallyLinkedTo

        public TableName[] queryTablesRelationallyLinkedTo​(TableName table)
        Same as the Transaction.queryTablesRelationallyLinkedTo method.
      • queryTableUniqueGroups

        public Transaction.ColumnGroup[] queryTableUniqueGroups​(TableName table_name)
        Same as the Transaction.queryTableUniqueGroups method.
      • queryTablePrimaryKeyGroup

        public Transaction.ColumnGroup queryTablePrimaryKeyGroup​(TableName table_name)
        Same as the Transaction.queryTablePrimaryKeyGroup method.
      • queryTableImportedForeignKeyReferences

        public Transaction.ColumnGroupReference[] queryTableImportedForeignKeyReferences​(TableName table_name)
        Same as the Transaction.queryTableImportedForeignKeyReferences method.
      • fireTrigger

        public void fireTrigger​(DatabaseConnection database,
                                java.lang.String trigger_name,
                                TriggerEvent evt)
        Notifies when a trigger has fired for this user. If there are no open transactions on this connection then we do a straight call back trigger notify. If there is a transaction open then trigger events are added to the 'trigger_event_buffer' which fires when the connection transaction is committed or rolled back.
        Specified by:
        fireTrigger in interface TriggerListener
        Parameters:
        database - the DatabaseConnection that this trigger is registered for.
        evt - the trigger event that was fired.
      • commit

        public void commit()
                    throws TransactionException
        Tries to commit the current transaction. If the transaction can not be committed because there were concurrent changes that interfered with each other then a TransactionError is thrown and the transaction is rolled back.

        NOTE: It's guarenteed that the transaction will be closed even if a transaction exception occurs.

        Synchronization is implied on this method, because the locking mechanism should be exclusive when this is called.

        Throws:
        TransactionException
      • rollback

        public void rollback()
        Rolls back the current transaction operating within this connection.

        NOTE: It's guarenteed that the transaction will be closed even if an exception occurs.

        Synchronization is implied on this method, because the locking mechanism should be exclusive when this is called.

      • close

        public void close()
        Closes this database connection.
      • finalize

        public void finalize()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable