[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5019) @TableGenerator throws Unsupported exception - error performing isolated work

Petr H (JIRA) noreply at atlassian.com
Mon May 31 10:11:54 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=37307#action_37307 ] 

Petr H commented on HHH-5019:
-----------------------------

I think the shown stacktrace appears to be incomplete, missing the cause of that exception.
I bet the cause is java.lang.UnsupportedOperationException thrown by WebSphereExtendedJTATransactionLookup$TransactionManagerAdapter suspend method.
We've been facing similar problem when doing updates of data over multiple tables.
Here Hibernate utilizes temporary tables and in many cases it might end up on attempt to suspend current transaction (when it goes via the Isolater.etc.)
But WebSphereExtendedJTATransactionLookup doesn't implement transaction suspend/resume and throws the UnsupportedOperationException and that's pretty bad.
I think the case described here is pretty much the same thing, though the actual data operation is different.

Possible workarounds are something like:
use the old WebSphereTransactionManagerLookup - but this may introduce some other issues elsewhere (and it does)
rewrite the code to avoid transaction suspension attempts

It would be really great to bring the UOWManager support into Hibernate, see:
http://itdevworld.wordpress.com/2009/01/23/websphere-uow-transactionmanagerlookup-for-hibernate/
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2703
https://forum.hibernate.org/viewtopic.php?uid=70595&f=1&t=992310&start=0

and bring the transaction suspend/resume to life here as Spring does have it AFAIK.

> @TableGenerator throws Unsupported exception - error performing isolated work
> -----------------------------------------------------------------------------
>
>                 Key: HHH-5019
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5019
>             Project: Hibernate Core
>          Issue Type: Bug
>    Affects Versions: 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.4.sp1, 3.2.5, 3.2.6, 3.2.7, 3.3.0.CR1, 3.3.0.CR2, 3.3.0.GA, 3.3.0.SP1, 3.3.1
>         Environment: Hibernate Core 3.3.1, MySQL, Websphere 6.1 with EJB3.0 Feature pack
>            Reporter: Tulips
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list