Hai All,
I have two EJBs (ejb1, ejb2 ) which are deployed in two instances of WA3.5.
From one mothod of ejb1, I am looking up the second ejb (ejb2) ,getting its remote object (i am not atall calling any mothod of ejb2, just lookup only) and after that I am calling one sql query by getting the connection using Datasouce.
In this case I am getting the follwing remote exception. But i have observered that Then these two operations of ejb1 method (i,e getting the remote object of ejb2 and execution of sql query) are exccuting successfully. But the container is throwing the follwing exception while returning from the method .
If i comment either sql query execution or getting the remote object of ejb2, it is not giving any problem. And also if we deploy both ejbs in one instance only, Then also, i am not geeting any broblem with these two calls.
I have tested with different combinations of txn attributes. If i set the txn attribute of ejb1 as Txn_Required or Txn_Required_New or supports, It is giving the problem irrespective of ejb2 txn attrbute. If i set txn attribute of ejb1 as not supports or bean_managed, It is working fine.
The database is DB2.
The code, I was using is
"
Hashtable parms = new Hashtable();
parms.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
parms.put(Context.PROVIDER_URL, "iiop://deepa:900");
InitialContext ic = new InitialContext(parms);
AlertsInfoEJBHome home=(AlertsInfoEJBHome)ic.lookup("com/americanexpress/alerts/ejb/AlertsInfoEJB");
AlertsInfoEJB a=home.create();
DataSource ds=(DataSource)ic.lookup("jdbc/GNSDB");
Connection con=ds.getConnection("db2admin","db2admin");
String sqlQuery="select * from customertable";
Statement st=con.createStatement(sqlQuery);
ResultSet rs=st.executeQuery();
"
The Remote exception I was geeting is
CORBA TRANSACTION_ROLLEDBACK 0 No; nested exception is: org.omg.CORBA.TRANSACTION_ROLLEDBACK: com.ibm.websphere.csi.CSITransactionRolledbackException: java.lang.Throwable(java.lang.String) java.lang.Exception(java.lang.String) java.io.IOException(java.lang.String) java.rmi.RemoteException(java.lang.String) com.ibm.websphere.csi.CSIException(java.lang.String) com.ibm.websphere.csi.CSITransactionRolledbackException(java.lang.String) void com.ibm.ejs.csi.TranStrategy.commit() void com.ibm.ejs.csi.TranStrategy.postInvoke(com.ibm.websphere.csi.EJBKey, com.ibm.ejs.csi.TxCookieImpl) void com.ibm.ejs.csi.TransactionControlImpl.postInvoke(com.ibm.websphere.csi.EJBKey, com.ibm.websphere.csi.TxCookie, com.ibm.websphere.csi.ExceptionType) void com.ibm.ejs.container.EJSContainer.postInvoke(com.ibm.ejs.container.EJSWrapper, int, com.ibm.ejs.container.EJSDeployedSupport) void com.americanexpress.alerts.eac.test.EJSRemoteEACTest.addDevice() org.omg.CORBA.portable.OutputStream com.americanexpress.alerts.eac.test._EJSRemoteEACTest_Tie._invoke(java.lang.String, org.omg.CORBA.portable.InputStream, org.omg.CORBA.portable.ResponseHandler) com.ibm.rmi.ServerResponse com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(com.ibm.rmi.ServerRequest) com.ibm.rmi.ServerResponse com.ibm.CORBA.iiop.ORB.process(com.ibm.rmi.ServerRequest) void com.ibm.CORBA.iiop.WorkerThread.run() void com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run() minor code: 0 completed: No
Thanks for any help!
Tnaks And Regards
S.Anjaneyulu