This content has been marked as final.
Show 3 replies
-
1. Re: Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; in jboss 5.1.0
jaikiran Apr 20, 2010 8:18 AM (in response to anithakothandapani)There will be some other exception earlier in the logs which will show why the transaction was marked for rollback.
-
2. Re: Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; in jboss 5.1.0
anithakothandapani May 3, 2010 2:31 AM (in response to jaikiran)Hi Jaikiran
Thanks for your reply.
I did not get any information on why the transaction was marked for rollback in the error logs.
Given below is the sample snippet , I was getting the exception in
conn = ds.getConnection(); line of getCode() method.
public boolean myInsertMethod() throws Exception{ DataSource ds = DAOHelper.getDataSource("myDS"); conn = ds.getConnection(); userTransaction = DAOHelper.getUserTransaction(); userTransaction.begin(); String myCode=getCode(); // Data base insert operation userTransaction.commit(); } String getCode() throws Exception{ DataSource ds = DAOHelper.getDataSource("myDS"); conn = ds.getConnection(); // Database Select operation }
-
3. Re: Caused by: org.jboss.resource.JBossResourceException: Could not enlist in transaction on entering meta-aware object!; in jboss 5.1.0
anithakothandapani May 3, 2010 2:46 AM (in response to anithakothandapani)Hi
I solved this issue by doing like this
public boolean myInsertMethod() throws Exception{ userTransaction = DAOHelper.getUserTransaction(); userTransaction.begin(); DataSource ds = DAOHelper.getDataSource("myDS"); conn = ds.getConnection(); String myCode=getCode(); // Data base insert operation userTransaction.commit(); }
i.e I moved the getConnection() method after beginning the userTransaction.