23 Jan 2012 21:53
[jetty-user] Extra setup for Jetty/Atomikos/Hibernate/JPA to get EntityManagerFactory reference in J2SE web application?
Justin Cranford <justincranford <at> hotmail.com>
2012-01-23 20:53:00 GMT
2012-01-23 20:53:00 GMT
Hi,
I am running Jetty Hightide 8.0.4. I set up my Derby and Atomikos context according to this wiki.
http://docs.codehaus.org/display/JETTY/Atomikos
Note I am using the J2SE Atomikos classes (com.atomikos.icatch.jta.UserTransactionManager and com.atomikos.icatch.jta.UserTransactionImp), not the J2EE classes (com.atomikos.icatch.jta.J2eeTransactionManager and com.atomikos.icatch.jta.J2eeUserTransaction).
The context works fine; I can do JNDI lookups for "java:/comp/env/jdbc/myDS" and "java:comp/env/TransactionManager" and use them to execute some SQL.
What other configuration is required get EntityManagerFactory and EntityManager? Is there extra context and config information required to setup Hibernate/JPA to use the Atomikos DataSource and TransactionManager?
I tried <at> PersistenceContext in my web application, but it is NULL. I assume it is not injected because my app is J2SE, not J2EE.
Your help is appreciated. Thank you.
Sincerely,
Justin
I am running Jetty Hightide 8.0.4. I set up my Derby and Atomikos context according to this wiki.
http://docs.codehaus.org/display/JETTY/Atomikos
Note I am using the J2SE Atomikos classes (com.atomikos.icatch.jta.UserTransactionManager and com.atomikos.icatch.jta.UserTransactionImp), not the J2EE classes (com.atomikos.icatch.jta.J2eeTransactionManager and com.atomikos.icatch.jta.J2eeUserTransaction).
The context works fine; I can do JNDI lookups for "java:/comp/env/jdbc/myDS" and "java:comp/env/TransactionManager" and use them to execute some SQL.
What other configuration is required get EntityManagerFactory and EntityManager? Is there extra context and config information required to setup Hibernate/JPA to use the Atomikos DataSource and TransactionManager?
I tried <at> PersistenceContext in my web application, but it is NULL. I assume it is not injected because my app is J2SE, not J2EE.
Your help is appreciated. Thank you.
Sincerely,
Justin
RSS Feed