Class SQLTransaction
- All Implemented Interfaces:
- com.isomorphic.base.IAutoConfigurable
-  Method SummaryModifier and TypeMethodDescriptionstatic voidcommitTransaction(DSTransaction dsTransaction) Commit the current transactionstatic voidcommitTransaction(RPCManager rpcManager) Commit the current transactionstatic voidendTransaction(DSTransaction dsTransaction) End the current transaction.static voidendTransaction(RPCManager rpcManager) End the current transaction.static ConnectiongetConnection(DSTransaction dsTransaction) Returns the connection participating in the transaction.static ConnectiongetConnection(RPCManager rpcManager) Returns the connection participating in the transaction.static booleanisConnectionAvailable(DSTransaction dsTransaction, String dbName) Checks if a SQL connection object is available for the specifiedDSTransaction.static booleanisConnectionAvailable(RPCManager rpcManager, String dbName) Checks if a SQL connection object is available for the specifiedDSTransaction.static voidrollbackTransaction(DSTransaction dsTransaction) Rollback the current transactionstatic voidrollbackTransaction(RPCManager rpcManager) Rollback the current transactionstatic voidsetAutoEndTransactions(boolean autoEnd) Sets automatic transaction end support.static booleanstartTransaction(DSTransaction dsTransaction) Starts a new database transaction.static booleanstartTransaction(RPCManager rpcManager) Starts a new database transaction.
-  Method Details-  setAutoEndTransactionspublic static void setAutoEndTransactions(boolean autoEnd) Sets automatic transaction end support. When this is on, transaction support is ended when you commit or rollback a transaction; any further database operations in this HTTP request will be auto-committed. When this is off, transaction support persists beyond a commit or rollback boundary, so further database operations in this HTTP request will be part of a new transaction and must be committed manually. By default, automatic transaction end support is off. This means that your code is responsible for calling endTransaction().- Parameters:
- autoEnd- If true, switches on auto-end support
 
-  startTransactionStarts a new database transaction. Note that when you use transactional support, your code is responsible for calling endTransaction() - if you neglect to do so, you will cause connection leaks. It is possible to have the transaction manager end transactions automatically for you after a commit or rollback - this facility is controlled by the static SQLTransaction.setAutoEndTransactions() method.Please note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or usestartTransaction(DSTransaction)instead.- Returns:
- true if we started transaction support, or false if transaction support was already active
- Throws:
- Exception
 
-  startTransactionStarts a new database transaction. Note that when you use transactional support, your code is responsible for calling endTransaction() - if you neglect to do so, you will cause connection leaks. It is possible to have the transaction manager end transactions automatically for you after a commit or rollback - this facility is controlled by the static SQLTransaction.setAutoEndTransactions() method.- Returns:
- true if we started transaction support, or false if transaction support was already active
- Throws:
- Exception
 
-  getConnectionReturns the connection participating in the transaction. This will be null until startTransaction() is called.Please note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or usegetConnection(DSTransaction)instead.- Throws:
- Exception- if there is a configuration error with one of the underlying datasources
 
-  getConnectionReturns the connection participating in the transaction. This will be null until startTransaction() is called.- Throws:
- Exception- if there is a configuration error with one of the underlying datasources
 
-  rollbackTransactionRollback the current transactionPlease note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or userollbackTransaction(DSTransaction)instead.- Throws:
- Exception- if problems were found rolling back the transaction
 
-  rollbackTransactionRollback the current transaction- Throws:
- Exception- if problems were found rolling back the transaction
 
-  commitTransactionCommit the current transactionPlease note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or usecommitTransaction(DSTransaction)instead.- Throws:
- Exception- if problems were found committing the transaction
 
-  commitTransactionCommit the current transaction- Throws:
- Exception- if problems were found committing the transaction
 
-  isConnectionAvailableChecks if a SQL connection object is available for the specifiedDSTransaction.Please note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or useisConnectionAvailable(DSTransaction, String)instead.- Parameters:
- rpcManager- the RPCManager to check for a SQL connection on.
- dbName- the name of the database.
- Returns:
- true if a connections exists (not null) or false if there is no connection available.
 
-  isConnectionAvailableChecks if a SQL connection object is available for the specifiedDSTransaction.- Parameters:
- dsTransaction- the DSTransaction to check for a SQL connection on.
- dbName- the name of the database.
- Returns:
- true if a connections exists (not null) or false if there is no connection available.
 
-  endTransactionEnd the current transaction. "Ending" a transaction simply means surrendering the database connection we are using to represent the transaction back to the pool. Any further database operations in this HTTP request will take place on an auto-commit basis, unless you issue another startTransaction call. Note that startTransaction() calls MUST be paired with endTransaction() calls, unless you have set the transaction manager into auto-end mode (see SQLTransaction.setAutoEndTransactions()).Please note that if you are manually handling the transaction you should have set it on the RPCManagerbefore calling this method or useendTransaction(DSTransaction, String)instead.- Throws:
- Exception- if problems were found ending the transaction
 
-  endTransactionEnd the current transaction. "Ending" a transaction simply means surrendering the database connection we are using to represent the transaction back to the pool. Any further database operations in this HTTP request will take place on an auto-commit basis, unless you issue another startTransaction call. Note that startTransaction() calls MUST be paired with endTransaction() calls, unless you have set the transaction manager into auto-end mode (see SQLTransaction.setAutoEndTransactions()).- Throws:
- Exception- if problems were found ending the transaction
 
 
-