Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two persistance-unit at persistence.xml for two database but its thows exception

 
akhtar qureshi
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
16:47:07,189 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@126e598
16:47:07,193 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
16:47:07,193 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: 7f000001:e14e:4b7e6e4f:2c1 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: 7f000001:e14e:4b7e6e4f:2c1 status: ActionStatus.ABORT_ONLY >))
16:47:07,193 INFO [STDOUT] org.hibernate.exception.GenericJDBCException: Cannot open connection

my persistence.xml file as below :

<persistence-unit name="MySqlDS">
<jta-data-source>java:/jdbc/tattooDS</jta-data-source>
<properties>

<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>
<persistence-unit name="JoomlaDS">
<jta-data-source>java:/jdbc/joomlaDS</jta-data-source>
<properties>

<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>

first Database sessionBean class:
public class CustomersBean implements IRCustomers {

@PersistenceContext(unitName="MySqlDS")
private EntityManager em;

}
Second Database session Bean class:

@Stateless
public class Jos_UserBean implements IRJos_User {

@PersistenceContext(unitName="JoomlaDS")
private EntityManager em;
}


please Help me out, is it possible to use two different database in one ejb
 
dwarakanathan thiru
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Were you able to get some solution for this within the applications EAR file?
You can change the jboss JTA properties file to fix this solution.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic