@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!

Brett MeyerApril 7, 2014 at 5:44 PM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

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.

MarkoJanuary 23, 2011 at 3:36 PM

Correction for previous comment:
boolean existingTx = (getUOWStatus() != UOW_STATUS_NONE &&
uowManager.getUOWType() != UOW_TYPE_LOCAL_TRANSACTION);
return existingTx ? Status.STATUS_ACTIVE: Status.STATUS_NO_TRANSACTION;

MarkoJanuary 22, 2011 at 12:35 AM

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;

Rejected

Details

Assignee

Reporter

Priority

Created March 18, 2010 at 11:14 AM
Updated July 8, 2014 at 3:11 PM
Resolved July 8, 2014 at 3:11 PM

Flag notifications