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

Environment

Hibernate Core 3.3.1, MySQL, Websphere 6.1 with EJB3.0 Feature pack

Activity

Show:
Marko
January 22, 2011, 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;

Marko
January 23, 2011, 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;

Ondrej Motlik
February 11, 2011, 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.

Brett Meyer
April 7, 2014, 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!

Brett Meyer
July 8, 2014, 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!

Assignee

Unassigned

Reporter

Tulips

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure