@TableGenerator throws Unsupported exception - error performing isolated work
Description
While implementing GenerationType.TABLE strategy with Hibernate as the persistence provider, id generation throws
javax.persistence.PersistenceException: org.hibernate.HibernateException: error performing isolated work [3/18/10 14:40:41:533 IST] 0000002d SystemErr R at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614) --------------------------------------------------------------
3/18/10 14:40:41:533 IST] 0000002d SystemErr R Caused by: org.hibernate.HibernateException: error performing isolated work at org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:166) at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:64) at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:74) at org.hibernate.id.MultipleHiLoPerTableGenerator.generate(MultipleHiLoPerTableGenerator.java:210)
Looking at the Isolater.doIsolatedWork( work, session );, implementation
try { // First we need to suspend any current JTA transaction and obtain // a JDBC connection surroundingTransaction = transactionManager.suspend(); if ( log.isDebugEnabled() ) { log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" ); } This happnes only with WebsphereExtendedTransactionManagerLookup as the hibernate.transaction.manager_lookup_class.
Activity
Brett MeyerJuly 8, 2014 at 3:11 PM
Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.
Thank you!
Ondrej MotlikFebruary 11, 2011 at 1:11 PM
It would be great to fix this issue, because we have experienced the same problems described by Petr H and the others.
The class WebSphereUOWTransactionLookup$UOWTransactionAdapter (the fix suggested by Rafael) has an invalid implementation for the getStatus() method. The correct implementation should be Integer(0).equals(getLocalId()) ? Status.STATUS_ACTIVE :Status.STATUS_NO_TRANSACTION;
While implementing GenerationType.TABLE strategy with Hibernate as the persistence provider, id generation throws
javax.persistence.PersistenceException: org.hibernate.HibernateException: error performing isolated work
[3/18/10 14:40:41:533 IST] 0000002d SystemErr R at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
-------------------------------------------------------------- 3/18/10 14:40:41:533 IST] 0000002d SystemErr R Caused by: org.hibernate.HibernateException: error performing isolated work
at org.hibernate.engine.transaction.Isolater$JtaDelegate.delegateWork(Isolater.java:166)
at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:64)
at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:74)
at org.hibernate.id.MultipleHiLoPerTableGenerator.generate(MultipleHiLoPerTableGenerator.java:210)
Looking at the
Isolater.doIsolatedWork( work, session );, implementation
try {
// First we need to suspend any current JTA transaction and obtain
// a JDBC connection
surroundingTransaction = transactionManager.suspend();
if ( log.isDebugEnabled() ) {
log.debug( "surrounding JTA transaction suspended [" + surroundingTransaction + "]" );
}
This happnes only with WebsphereExtendedTransactionManagerLookup as the hibernate.transaction.manager_lookup_class.