春季JTA配置 - 如何设置事务管理器?
我们在Spring配置中将Spring事务配置为:
<tx:jta-transaction-manager/>
我收集这意味着Spring将自动发现底层的JTA实现。因此,当我们启动JBoss时,我们会在Spring搜索时看到以下消息:
[JtaTransactionManager] [ ] No JTA TransactionManager found at fallback JNDI location [java:comp/Tran
sactionManager]
javax.naming.NameNotFoundException: TransactionManager not bound
<<Big stack trace>>
<<More of the same>>
然后最终看到:
[JtaTransactionManager] [ ] JTA TransactionManager found at fallback JNDI location [java:/Transaction
Manager]
[JtaTransactionManager] [ ] Using JTA UserTransaction: org.jboss.tm.usertx.client.ServerVMClientUserT
ransaction@1f78dde
问题是 - 我们如何编辑我们的标签来显式配置JTA实现,以便我们避免日志中的所有这些堆栈跟踪?(我宁愿不只是更改Log4J日志记录级别)<tx:jta-transaction-manager/>
java:/Transaction Manager
更新:我用下面的配置替换了,它似乎工作。我猜这没关系?<tx:jta-transaction-manager/>
<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
<property name="transactionManagerName" value="java:/TransactionManager"/>
</bean>