Package org.jdbi.v3.core.transaction
Class CMTTransactionHandler
java.lang.Object
org.jdbi.v3.core.transaction.CMTTransactionHandler
- All Implemented Interfaces:
- TransactionHandler
Handler designed to behave properly in a J2EE CMT environment. It will never
 explicitly begin or commit a transaction, and will throw a runtime exception
 when rollback is called to force rollback.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCalled when a transaction is startedvoidCalled when a transaction is committed<R,X extends Exception> 
 RinTransaction(Handle handle, HandleCallback<R, X> callback) Run a transaction.<R,X extends Exception> 
 RinTransaction(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) Run a transaction.booleanisInTransaction(Handle handle) Called to test if a handle is in a transactionvoidreleaseSavepoint(Handle handle, String savepointName) Savepoints are not supported.voidCalled when a transaction is rolled back Will throw a RuntimeException to force transactional rollbackvoidrollbackToSavepoint(Handle handle, String name) Savepoints are not supported.voidSavepoints are not supported.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jdbi.v3.core.transaction.TransactionHandlerspecialize
- 
Constructor Details- 
CMTTransactionHandlerpublic CMTTransactionHandler()
 
- 
- 
Method Details- 
beginCalled when a transaction is started- Specified by:
- beginin interface- TransactionHandler
- Parameters:
- handle- the handle the transaction is being started on
 
- 
commitCalled when a transaction is committed- Specified by:
- commitin interface- TransactionHandler
- Parameters:
- handle- the handle the commit is being performed on
 
- 
rollbackCalled when a transaction is rolled back Will throw a RuntimeException to force transactional rollback- Specified by:
- rollbackin interface- TransactionHandler
- Parameters:
- handle- the handle the rollback is being performed on
 
- 
rollbackToSavepointSavepoints are not supported.- Specified by:
- rollbackToSavepointin interface- TransactionHandler
- Parameters:
- handle- the handle the rollback is being performed on
- name- the name of the savepoint to rollback to
 
- 
isInTransactionCalled to test if a handle is in a transaction- Specified by:
- isInTransactionin interface- TransactionHandler
- Parameters:
- handle- the handle to test
- Returns:
- whether the given handle is in a transaction
 
- 
savepointSavepoints are not supported.- Specified by:
- savepointin interface- TransactionHandler
- Parameters:
- handle- the handle on which the transaction is being savepointed
- name- The name of the savepoint, used to rollback to or release later
 
- 
releaseSavepointSavepoints are not supported.- Specified by:
- releaseSavepointin interface- TransactionHandler
- Parameters:
- handle- the handle on which the savepoint is being released
- savepointName- the savepoint to release
 
- 
inTransactionpublic <R,X extends Exception> R inTransaction(Handle handle, HandleCallback<R, X> callback) throws XDescription copied from interface:TransactionHandlerRun a transaction.- Specified by:
- inTransactionin interface- TransactionHandler
- Type Parameters:
- R- the callback return type
- X- the exception type thrown by the callback, if any
- Parameters:
- handle- the handle to the database
- callback- a callback which will receive the open handle, in a transaction.
- Returns:
- the value returned by the callback.
- Throws:
- X- any exception thrown by the callback.
- See Also:
 
- 
inTransactionpublic <R,X extends Exception> R inTransaction(Handle handle, TransactionIsolationLevel level, HandleCallback<R, X> callback) throws XDescription copied from interface:TransactionHandlerRun a transaction.- Specified by:
- inTransactionin interface- TransactionHandler
- Type Parameters:
- R- the callback return type
- X- the exception type thrown by the callback, if any
- Parameters:
- handle- the handle to the database
- level- the isolation level for the transaction
- callback- a callback which will receive the open handle, in a transaction.
- Returns:
- the value returned by the callback.
- Throws:
- X- any exception thrown by the callback.
- See Also:
 
 
-