aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Two persistance-unit at persistence.xml for two database but its thows exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Two persistance-unit at persistence.xml for two database but its thows exception" Watch "Two persistance-unit at persistence.xml for two database but its thows exception" New topic
Author

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

akhtar qureshi
Greenhorn

Joined: Nov 24, 2009
Posts: 16
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

Joined: Oct 14, 2009
Posts: 49
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.


Thanks,
Dwarak T
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two persistance-unit at persistence.xml for two database but its thows exception