[jboss-user] [JBoss Seam] - Re: Multiple Datasources
Hello, multiple Datasources works, but only with specific databases. I think that this is a question that belongs in a forum corresponding to the container you use. Datasources are configured in a container(Tomxcat Jboss glassfish..) But see here.. http://www.jboss.com/index.html?module=bbop=viewtopict=113622 http://www.jboss.com/index.html?module=bbop=viewtopict=113633 View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4088681#4088681 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4088681 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
marcosH would you be so kind to share your solution with me? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036940#4036940 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036940 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
marcosH would you be so kind to share your solution with me? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036942#4036942 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036942 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
I have followed the advise, but still having the problem in the first post. My entities are bound to both datasources. I do not have a clue what i have missed:-( [qoute]bind my entities using the @PersistenceUnits annotation View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036778#4036778 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036778 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
Sorry, tried again. I have followed the advise, but still having the problem in the first post. My entities are bound to both datasources. I do not have a clue what i have missed:-( anonymous wrote : bind my entities using the @PersistenceUnits annotation Perhaps this is the key. But in which way i must anotate my entities? Ciao, Carsten View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4036779#4036779 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4036779 ___ jboss-user mailing list [EMAIL PROTECTED] https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
datasource... | datasources | | local-tx-datasource | jndi-namePostgresDS1/jndi-name | connection-urljdbc:postgresql://localhost:5432/db1/connection-url | driver-classorg.postgresql.Driver/driver-class | user-namedb1/user-name | passworddb1/password | max-pool-size35/max-pool-size | blocking-timeout-millis6/blocking-timeout-millis | metadata | type-mappingPostgreSQL 8.0/type-mapping | /metadata | /local-tx-datasource | | local-tx-datasource | jndi-namePostgresDS2/jndi-name | connection-urljdbc:postgresql://localhost:5432/db2/connection-url | driver-classorg.postgresql.Driver/driver-class | user-namedb2/user-name | passworddb2/password | max-pool-size35/max-pool-size | blocking-timeout-millis6/blocking-timeout-millis | metadata | type-mappingPostgreSQL 8.0/type-mapping | /metadata | /local-tx-datasource | | /datasources | persistence.xml... | 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=db1-PU transaction-type=JTA | providerorg.hibernate.ejb.HibernatePersistence/provider | jta-data-sourcejava:/PostgresDS1/jta-data-source | properties | property name=show_sql value=true/ | property name=hibernate.hbm2ddl.auto value=update/ | property name=hibernate.dialect value=org.hibernate.dialect.PostgreSQLDialect / | property name=jboss.entity.manager.jndi.name value=java:/DB1EntityManager/ | property name=jboss.entity.manager.factory.jndi.name value=java:/DB1EntityManagerFactory/ | /properties | /persistence-unit | | persistence-unit name=db2-PU transaction-type=JTA | providerorg.hibernate.ejb.HibernatePersistence/provider | jta-data-sourcejava:/PostgresDS2/jta-data-source | properties | property name=show_sql value=true/ | property name=hibernate.hbm2ddl.auto value=update/ | property name=hibernate.dialect value=org.hibernate.dialect.PostgreSQLDialect / | property name=jboss.entity.manager.jndi.name value=java:/DB2EntityManager/ | property name=jboss.entity.manager.factory.jndi.name value=java:/DB2EntityManagerFactory/ | /properties | /persistence-unit | /persistence | Source code... | @PersistenceContext(unitName=db1-PU) | private EntityManager db1EntityManager; | | @PersistenceContext(unitName=db2-PU) | private EntityManager db2EntityManager; | Notice the jta-data-source value in the persistence.xml matches the jndi-name in the datasource. Then the source code annotates two different instances of an EntityManager with the appropriate PersistenceContext View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4034669#4034669 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034669 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user
[jboss-user] [JBoss Seam] - Re: Multiple datasources?
Ok!! Thanks for the reply, it works fine!! View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=4034790#4034790 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4034790 ___ jboss-user mailing list jboss-user@lists.jboss.org https://lists.jboss.org/mailman/listinfo/jboss-user