不使用 Spring 配置 JPA 和 JOTM
谁能给我提供一个在未使用 Spring 的环境中配置 JPA/JOTM 的示例吗?
我正在使用 Tomcat 和 JPA/MySQL 构建一个网络应用程序。目前,我只是在 JPA 持久性单元中使用 RESOURCE_LOCAL 事务,但如果可能的话,我想迁移到真正的事务管理器 (JOTM)。我查遍了整个网络,似乎能找到的都是使用 Spring 的示例。
有人能指出我正确的方向吗?
谢谢
Can anyone point me to an example of configuring JPA/JOTM in an environment where Spring isn't being used?
I'm building a web-app with Tomcat and JPA/MySQL. Currently I'm just using the RESOURCE_LOCAL transactions in the JPA persistence unit, but I'd like to move to a real transaction manager (JOTM) if possible. I've looked all over the web and all I seem to be able to find are examples using Spring.
Can anyone point me in the right direction?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JBoss 有一篇有趣的文章,展示了如何使用各种独立事务管理器配置 Hibernate,包括 JOTM(文章涵盖的内容不仅限于但很好,能做更多的人可以做得更少),以及没有 Spring。
但实际上,我的建议是使用 Atomikos(本文介绍过)而不是 JOTM,因为它是一个很棒的产品,并且:
以防万一,我在之前的答案中写了有关独立事务管理器的文章。
JBoss has an interesting article showing how to configure Hibernate with various standalone transaction managers, including JOTM (the article covers more than than but well, he who can do more can do less), and WITHOUT Spring.
But actually, my suggestion would be to use Atomikos (which is covered by the article) instead of JOTM because it's a great product and:
Just in case, I wrote about standalone transaction managers in this previous answer.