简体   繁体   中英

Create a local transaction inside a Spring JTA transaction

I want to execute a stored procedure inside a JTA transaction, but have to use a local transaction instead for some reason. I've create a pointcut, using a local transaction manager for this, but exception threw as below. Did anyone have such problem? How you solve this?

*

After increasing transaction time-out to 300, no timeout exception. But the following exception is still thrown:
Exception [TOPLINK-23011] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070428)): oracle.toplink.exceptions.TransactionException
Exception Description: UnitOfWork [UnitOfWork(
 DatabaseAccessor(connected)
 Oracle10Platform)] was rendered inactive before associated externally managed transaction was complete.
 at oracle.toplink.exceptions.TransactionException.inactiveUnitOfWork(TransactionException.java:105)

*

Why can't you use Spring's "requires new" transaction annotation? You get then a new transaction and if that transaction involves a single resource it is as good as a "local" transaction.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM