org.hibernate.engine.transaction.spi
Interface TransactionFactory<T extends TransactionImplementor>

All Superinterfaces:
Serializable, Service
All Known Implementing Classes:
CMTTransactionFactory, JdbcTransactionFactory, JtaTransactionFactory

public interface TransactionFactory<T extends TransactionImplementor>
extends Service

Contract for transaction creation, as well as providing metadata and contextual information about that creation.


Method Summary
 boolean canBeDriver()
          Can the transactions created from this strategy act as the driver? In other words can the user actually manage transactions with this strategy?
 boolean compatibleWithJtaSynchronization()
          Should we attempt to register JTA transaction synchronizations.
 T createTransaction(TransactionCoordinator coordinator)
          Construct a transaction instance compatible with this strategy.
 ConnectionReleaseMode getDefaultReleaseMode()
          Get the default connection release mode.
 boolean isJoinableJtaTransaction(TransactionCoordinator transactionCoordinator, T transaction)
          Can the underlying transaction represented by the passed Hibernate TransactionImplementor be joined?
 

Method Detail

createTransaction

T createTransaction(TransactionCoordinator coordinator)
Construct a transaction instance compatible with this strategy.

Parameters:
coordinator - The coordinator for this transaction
Returns:
The appropriate transaction instance.
Throws:
HibernateException - Indicates a problem constructing the transaction.

canBeDriver

boolean canBeDriver()
Can the transactions created from this strategy act as the driver? In other words can the user actually manage transactions with this strategy?

Returns:
true if the transaction strategy represented by this factory can act as the driver callback; false otherwise.

compatibleWithJtaSynchronization

boolean compatibleWithJtaSynchronization()
Should we attempt to register JTA transaction synchronizations.

In other words, is this strategy JTA-based?

Returns:
true if the transaction strategy represented by this factory is compatible with registering synchronizations; false otherwise.

isJoinableJtaTransaction

boolean isJoinableJtaTransaction(TransactionCoordinator transactionCoordinator,
                                 T transaction)
Can the underlying transaction represented by the passed Hibernate TransactionImplementor be joined?

Parameters:
transactionCoordinator - The transaction coordinator
transaction - The current Hibernate transaction
Returns:
true is the transaction can be joined; false otherwise.

getDefaultReleaseMode

ConnectionReleaseMode getDefaultReleaseMode()
Get the default connection release mode.

Returns:
The default release mode associated with this strategy


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.