Configuring JPA and JOTM without 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
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:
It is currently the unique Transaction manager I've found with a online-documentation, how to integrate with Hiberante without Spring, outside any J2EE container. It seems to be the unique supporting XaDataSource together with Pooling, so it doesn't matter that It does not come with it's own JNDI implementation (we will use the one of JBoss in following example).
Just in case, I wrote about standalone transaction managers in this previous answer.
精彩评论