I am new to JBOSS 4.2.2 and have run into a problem posting a trasaction. I am working with EJB 3.0 sessions and entities and have what appears to be pretty straight-forward code.
I have two different EJB modules deployed as separate JARs to my app server. Each of these EJB modules relies on a different data source and I have both data sources defined in oracle-ds.xml (see below). I make a call to EJB Module 1 and that code then makes a call to EJB Module 2 to fetch some data I need. I then use this data to populate my entity in EJB Module 1 and then I try to persist it. I would appreciate any links to documentation or any helpful hints (I ordered two books today, but they will take a few days to arrive). Here are snippets from the error.
javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:63)
Caused by: org.jboss.util.NestedSQLException: 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: -53ef796d:67d:49fb3713:30 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: -53ef796d:67d:49fb3713:30 status: ActionStatus.ABORT_ONLY >))
I will take a look at tx-datasource and post back the results.
Joined: Feb 27, 2009
In my particular situation it was actually more efficient for me to define a couple of dblinks that provided access to the 2nd database. I went this route and now there is not need to attempt to manage txns across two dbs.