简体   繁体   English

在Spring JTA事务内创建本地事务

[英]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. 我想在JTA事务中执行存储过程,但由于某种原因不得不使用本地事务。 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? 为什么不能使用Spring的“需要新”交易注释? You get then a new transaction and if that transaction involves a single resource it is as good as a "local" transaction. 然后,您将获得一个新事务,如果该事务涉及单个资源,则它与“本地”事务一样好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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