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.
精彩评论