...
For a unit called "movie-unit" using two datasources called "movieDatabase" and "movieDatabaseUnmanaged" the following persistence.xml would work.
Code Block | |||||||
---|---|---|---|---|---|---|---|
| |||||||
<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="movie-unit"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>movieDatabase</jta-data-source> <non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> <property name="hibernate.transaction.manager_lookup_class" value="org.apache.openejb.hibernate.TransactionManagerLookup"/> </properties> </persistence-unit> </persistence> |
...
Info | ||
---|---|---|
| ||
I tried to use openejb 3.0 together with hibernate 3.2.6ga in a maven project. The transitive dependencies of openejb and hibernate collide on asm.jar. A similar problem is described here: http://blog.springsource.com/main/2007/06/11/asm-version-incompatibilities-using-spring-autowired-with-hibernate/ The solution is to exclude the dependency on asm and cglib on hibernate and to add a dependency on cglib-nodep. |