Class CMTTransactionHandler
java.lang.Object
org.jdbi.v3.core.transaction.NoOpTransactionHandler
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.
Unlike its base class NoOpTransactionHandler, this handler reads the
autocommit flag of the connection: when autocommit is disabled, the handle
reports an open transaction. Use NoOpTransactionHandler instead when
the connection is wrapped by a proxy on which the autocommit flag does not
show the real transaction state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisInTransaction(Handle handle) Called to test if a handle is in a transactionMethods inherited from class NoOpTransactionHandler
begin, commit, inTransaction, inTransaction, releaseSavepoint, rollback, rollbackToSavepoint, savepointMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TransactionHandler
specialize
-
Constructor Details
-
CMTTransactionHandler
public CMTTransactionHandler()
-
-
Method Details
-
isInTransaction
Called to test if a handle is in a transaction- Specified by:
isInTransactionin interfaceTransactionHandler- Overrides:
isInTransactionin classNoOpTransactionHandler- Parameters:
handle- the handle to test- Returns:
- whether the given handle is in a transaction
-