Darius
 
I had some similar problems and messages. In all the fiddling to get it fixed I figured it was the following:
 
I was adding rows of data, manually, to my Oracle database using Oracle SQLPlus. I then tried to access the same data which I had just added using my Entity Bean and if I remember correctly got the same exception you did. It turned out I forgot to commit the work done in SQLPlus i.e. after inserting data using SQLPlus type commit to actually commit.
 
So Oracle being pretty smart sees an attempt at a nested transaction since the work done in SQLPlus was not commited. Remeber the container will call ejbStore() as required, this is probably when the exception occurs. You may have the same problem.
 
Andrew
-----Original Message-----
From: Darius Davidavicius [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 07, 2000 5:37 AM
To: jBoss
Subject: Re: [jBoss-User] Transaction rolled back:javax/sql/DataSource ?

I still have problems :((

>Have you added a resource reference "jdbc/OraclePool" in your ejb-jar.xml?
Its mapped like in ejb-jar.xml:
<entity>
<ejb-name>EMailContact</ejb-name>
<home>com.ls.dialog.ejb.email.EMailContactHome</home>
<remote>com.ls.dialog.ejb.email.EMailContact</remote>
<ejb-class>com.ls.dialog.ejb.email.EMailContactBean</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.ls.dialog.ejb.contact.ContactPK</prim-key-class>
<reentrant>False</reentrant>

<resource-ref>
<res-ref-name>OraclePool</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</entity>

>Have you mapped this to "OraclePool" in jboss.xml?
Its mapped like:

<resource-managers>
<resource-manager res-class="org.jboss.ejb.deployment.JDBCResource">
<res-name>OraclePool</res-name>
<res-jndi-name>OraclePool</res-jndi-name>
</resource-manager>
</resource-managers>

<entity>
<ejb-name>EMailContact</ejb-name>
<jndi-name>EMailContactHome</jndi-name>
<resource-ref>
<res-ref-name>OraclePool</res-ref-name>
<resource-name>OraclePool</resource-name>
</resource-ref>
</entity>

And my client gets Exception :
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is: java.rmi.ServerException: Transaction rolled back:javax/sql/DataSource
when i do trying

initCtx = new InitialContext();
DataSource ds = (javax.sql.DataSource) initCtx.lookup("OraclePool");
return ds.getConnection();

Server logs tels me OraclePool is created:
[XADataSource] Starting
[XADataSource] XA Connection pool OraclePool bound to OraclePool
[XADataSource] Started

Where is my problem?
Thanks,
Darius Davidavicius



Reply via email to