public class HibernateJtaTransactionManagerAdapter extends java.lang.Object
Adapter for adding transaction controlling hooks for supporting Hibernate's org.hibernate.engine.transaction.Isolater class's interaction with transactions This is required when there is no real JTA transaction manager in use and Spring's org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy is used. Without this solution, using Hibernate's TableGenerator identity strategies will fail to support transactions. The id generator will commit the current transaction and break transactional behaviour. The javadoc of Hibernate's TableHiLoGenerator states this. However this isn't mentioned in the javadocs of other TableGenerators.
Constructor and description |
---|
HibernateJtaTransactionManagerAdapter
(org.springframework.transaction.PlatformTransactionManager springTransactionManager) |
Type Params | Return Type | Name and description |
---|---|---|
|
void |
begin() |
|
void |
commit() |
|
protected static int |
convertToJtaStatus(org.springframework.transaction.TransactionStatus status) |
|
protected org.springframework.transaction.TransactionStatus |
getAndRemoveStatus() |
|
int |
getStatus() |
|
javax.transaction.Transaction |
getTransaction() |
|
void |
resume(javax.transaction.Transaction tobj) |
|
void |
rollback() |
|
void |
setRollbackOnly() |
|
void |
setTransactionTimeout(int seconds) |
|
javax.transaction.Transaction |
suspend() |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |