Interface JtaPlatform
-
- All Superinterfaces:
Serializable,Service
- All Known Implementing Classes:
AbstractJtaPlatform,AtomikosJtaPlatform,BitronixJtaPlatform,BorlandEnterpriseServerJtaPlatform,JBossAppServerJtaPlatform,JBossStandAloneJtaPlatform,JOnASJtaPlatform,JOTMJtaPlatform,JRun4JtaPlatform,NoJtaPlatform,OC4JJtaPlatform,OrionJtaPlatform,ResinJtaPlatform,SapNetWeaverJtaPlatform,SunOneJtaPlatform,TestingJtaPlatformImpl,WeblogicJtaPlatform,WebSphereExtendedJtaPlatform,WebSphereJtaPlatform,WebSphereLibertyJtaPlatform,WildFlyStandAloneJtaPlatform
public interface JtaPlatform extends Service
AServicethat defines how Hibernate interacts with JTA on a certain platform. In particular, aJtaPlatformallows Hibernate to obtain theTransactionManagerandUserTransaction, and registerSynchronizations.An implementation may be selected by specifying the configuration property "hibernate.transaction.jta.platform". Alternatively, a
JtaPlatformProvideror even a customJtaPlatformResolvermay be used.- See Also:
JtaPlatformResolver,JtaPlatformProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanRegisterSynchronization()Can we currently register aSynchronization?intgetCurrentStatus()Obtain the current transaction status using whatever means is preferred for this platformObjectgetTransactionIdentifier(jakarta.transaction.Transaction transaction)Determine an identifier for the given transaction appropriate for use in caching/lookup usages.voidregisterSynchronization(jakarta.transaction.Synchronization synchronization)Register a JTASynchronizationin the means defined by the platform.jakarta.transaction.TransactionManagerretrieveTransactionManager()Locate theTransactionManager.jakarta.transaction.UserTransactionretrieveUserTransaction()Locate theUserTransaction.
-
-
-
Method Detail
-
retrieveTransactionManager
jakarta.transaction.TransactionManager retrieveTransactionManager()
Locate theTransactionManager.- Returns:
- The
TransactionManager
-
retrieveUserTransaction
jakarta.transaction.UserTransaction retrieveUserTransaction()
Locate theUserTransaction.If
AvailableSettings.PREFER_USER_TRANSACTIONis enabled, Hibernate will use theUserTransactionin preference to theTransactionManagerwhere possible.- Returns:
- The
UserTransaction
-
getTransactionIdentifier
Object getTransactionIdentifier(jakarta.transaction.Transaction transaction)
Determine an identifier for the given transaction appropriate for use in caching/lookup usages.Generally speaking the transaction itself will be returned here. This method was added specifically for use in WebSphere and other unfriendly Java EE containers.
- Parameters:
transaction- The transaction to be identified.- Returns:
- An appropriate identifier
-
canRegisterSynchronization
boolean canRegisterSynchronization()
Can we currently register aSynchronization?- Returns:
- True if registering a
Synchronizationis currently allowed; false otherwise.
-
registerSynchronization
void registerSynchronization(jakarta.transaction.Synchronization synchronization)
Register a JTASynchronizationin the means defined by the platform.- Parameters:
synchronization- The synchronization to register
-
getCurrentStatus
int getCurrentStatus() throws jakarta.transaction.SystemExceptionObtain the current transaction status using whatever means is preferred for this platform- Returns:
- The current status.
- Throws:
jakarta.transaction.SystemException- Indicates a problem access the underlying status
-
-