-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Cant open connection on second data source
PostPosted: Mon Dec 06, 2010 12:55 pm 
Newbie

Joined: Tue Aug 24, 2010 8:02 am
Posts: 3
In oracle I have two separate databases I need to pull information from. So I created a second data source in hibernate.

Here is my comfiguration:

dev.ds.xml
Code:
<datasources>
   
   <local-tx-datasource>
      <jndi-name>aggDatasource</jndi-name>
      <use-java-context>false</use-java-context>
      <connection-url>jdbc:oracle:thin:@ipaddress:port:tstdwrpt</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name></user-name>
      <password></password>
   </local-tx-datasource>
   
   <local-tx-datasource>
      <jndi-name>dmbDatasource</jndi-name>
      <use-java-context>false</use-java-context>
      <connection-url>jdbc:oracle:thin:@ipaddress:port:test10</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name></user-name>
      <password></password>
   </local-tx-datasource>
     
</datasources>


components.xml
Code:
<persistence:managed-persistence-context
      auto-create="true" name="entityManager" persistence-unit-jndi-name="java:/dmbEntityManagerFactory" />
<persistence:managed-persistence-context
      auto-create="true" name="aggEntityManager" persistence-unit-jndi-name="java:/aggEntityManagerFactory" />


persistence.xml
Code:
<persistence-unit name="agg">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>aggDatasource</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="none"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.default_schema" value=""/>
         <property name="hibernate.session_factory_name" value="aggSessionFactory" />
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/aggEntityManagerFactory"/>
      </properties>
   </persistence-unit>
             
   <persistence-unit name="dmb">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>dmbDatasource</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="none"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.default_schema" value=""/>
         <property name="hibernate.session_factory_name" value="dmbSessionFactory" />
         <property name="jboss.entity.manager.factory.jndi.name" value="java:/dmbEntityManagerFactory"/>
      </properties>
   </persistence-unit>


The aggDatasource is the one I'm getting the error on.
Here is a start to that error:
    11:11:03,244 WARN [loggerI18N] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] [com.arjuna.ats.internal.jta.transaction.arjunacore.lastResource.disallow] Adding multiple last resources is disallowed. Current resource is org.jboss.resource.connectionmanager.TxConnectionManager$LocalXAResource@419a00
    11:11:03,291 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
    11:11:03,291 ERROR [JDBCExceptionReporter] Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -7ffe2fd9:127a:4cfcf85a:13d status: ActionStatus.ABORT_ONLY >); - nested throwable: (org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; - nested throwable: (javax.transaction.SystemException: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: -7ffe2fd9:127a:4cfcf85a:13d status: ActionStatus.ABORT_ONLY >))
    11:11:03,307 ERROR [TxPolicy] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
    11:11:03,307 SEVERE [application] javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection
    javax.faces.el.EvaluationException: javax.ejb.EJBTransactionRolledbackException: org.hibernate.exception.GenericJDBCException: Cannot open connection


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.