This content has been marked as final.
Show 3 replies
-
1. Re: hbm2ddl and multiple datasources
dennisrjohn Dec 17, 2007 6:24 PM (in response to dennisrjohn)Sorry, typo in the persistence.xml, here;s the real thing:
<?xml version="1.0" encoding="UTF-8"?> <!-- Persistence deployment descriptor for dev profile --> <persistence 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" version="1.0"> <persistence-unit name="customerservice" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/customerserviceDatasource</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> </properties> </persistence-unit> <persistence-unit name="stoneedge" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/stoneedgeDatasource</jta-data-source> <properties> <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/> <property name="hibernate.hbm2ddl.auto" value="validate"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.format_sql" value="true"/> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/> </properties> </persistence-unit> </persistence>
-
2. Re: hbm2ddl and multiple datasources
dennisrjohn Dec 17, 2007 7:13 PM (in response to dennisrjohn)Also, I forgot to include the entity manager definitions in my pervious post:
components.xml:<persistence:managed-persistence-context name="entityManager" auto-create="true" entity-manager-factory="#{customerserviceEntityManagerFactory}"/> <persistence:entity-manager-factory name="customerserviceEntityManagerFactory" persistence-unit-name="customerservice"/> <persistence:managed-persistence-context name="stoneEdgeEntityManager" auto-create="true" entity-manager-factory="#{stoneedgeEntityManagerFactory}"/> <persistence:entity-manager-factory name="stoneedgeEntityManagerFactory" persistence-unit-name="stoneedge"/>
-
3. Re: hbm2ddl and multiple datasources
pmuir Dec 20, 2007 8:06 AM (in response to dennisrjohn)What is your question?