This content has been marked as final.
Show 3 replies
-
1. Re: Multiple persistence units (one JTA one RESOURCE_LOCAL)
mtedone1 Jun 12, 2007 4:59 PM (in response to mtedone1)Any news on this one?
-
2. Re: Multiple persistence units (one JTA one RESOURCE_LOCAL)
bmcgovern Jun 30, 2007 8:40 AM (in response to mtedone1)Mtedone1, I don't have an answer for you, but can you post your xml regarding JTA, I cannot get JTA working right on 4.2.0. Specifically I cannot seem to lookup TransactionManager from JNDI. I can get UserTransaction from JNDI, but when I do, the expected Transactional behavior simply doesn't work. THe system operates like there is no transaction running and i get partial commits.
Using UserTransaction I get a warning in the logs, but not an error : JTA cannot find TransactionManager, JTA will not be able to syncronize with existing JTA transactions.
So I think the root cause is something with JNDI and TransactionManger. Please paste your configs.
Thanks. -
3. Re: Multiple persistence units (one JTA one RESOURCE_LOCAL)
mtedone1 Jun 30, 2007 12:19 PM (in response to mtedone1)<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="jemos-ejb3-test" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/JemosTestDS</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.show_sql" value="true" /> </properties> </persistence-unit> <persistence-unit name="jemos-ejb3-test-junit" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>uk.co.jemos.ejb3.entities.Employee</class> <properties> <property name="hibernate.hbm2ddl.auto" value="update"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.username" value="user"/> <property name="hibernate.connection.password" value="password"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost/test"/> </properties> </persistence-unit> </persistence>