Spring JTA configuration - how to set TransactionManager?

后端 未结 2 997
执念已碎
执念已碎 2020-12-24 09:59

We configure our Spring transaction in Spring config as:


I gather this means that Spring will automatic

相关标签:
2条回答
  • 2020-12-24 10:55

    Yes, that's alright. The stack trace you were seeing was also alright: <tx:jta-transaction-manager/> tries to acquire the transaction manager from a number of different standard locations; for every failed JNDI lookup, you'll see the javax.naming.NameNotFoundException.

    java:/TransactionManager is where JBoss binds to by default; other servlet containers will default to java:/comp/TransactionManager, which I think is supposed to be the "standard" location for the TM.

    From the Spring reference documentation:

    For standard scenarios, including WebLogic, WebSphere and OC4J, consider using the convenient <tx:jta-transaction-manager/> configuration element. This will automatically detect the underlying server and choose the best transaction manager available for the platform. This means that you won't have to configure server-specific adapter classes (as discussed in the following sections) explicitly; they will rather be chosen automatically, with the standard JtaTransactionManager as default fallback.

    0 讨论(0)
  • 2020-12-24 10:58

    A common "mistake" is to bundle things like jta.jar and/or jbossall-client.jar in the J2EE component you deploy. Double check please and remove them if this is the case.

    0 讨论(0)
提交回复
热议问题