Hi!
Have a sessionBean where I have made a method removeKonsulent(short ansnr)
to delete a post in DB2.(create() works fine).
public void removeKonsulent(short ansnr) throws RemoteException, Exception {
try {
java.util.Hashtable p = new java.util.Hashtable();
p.put("java.naming.factory.initial",
"com.ibm.ejs.ns.jndi.CNInitialContextFactory");
InitialContext ctx = new InitialContext(p);
//get homeinterface
Object o = ctx.lookup("com_capgemini_no_heh_ejbentity_Konsulent");
KonsulentHome konshome =
(KonsulentHome)javax.rmi.PortableRemoteObject.narrow(o,
Class.forName("com.capgemini.no.heh.ejbentity.KonsulentHome"));
//Remove a Konsulent
KonsulentKey konskey = new KonsulentKey(ansnr);
Konsulent kons = konshome.findByPrimaryKey(konskey);
kons.remove();
} catch(RemoteException ex){
throw new RemoteException(ex.getMessage());
//System.out.println("Exception = " + ex.getMessage());
} catch(Exception ex){
throw new Exception(ex.getMessage());
//System.out.println("Exception = " + ex.getMessage());
}
}
Errormessage--->
org.omg.CORBA.TRANSACTION_ROLLEDBACK:
com.ibm.websphere.csi.CSITransactionRolledbackException
java.lang.Throwable()
java.lang.Exception()
java.io.IOException()
java.rmi.RemoteException()
com.ibm.websphere.csi.CSIException()
com.ibm.websphere.csi.CSITransactionRolledbackException()
void
com.ibm.ejs.csi.TranStrategy.handleException(com.ibm.websphere.csi.EJBKey,
com.ibm.ejs.csi.TxCookieImpl, com.ibm.websphere.csi.ExceptionType)
void
com.ibm.ejs.csi.TransactionControlImpl.postInvoke(com.ibm.websphere.csi.EJBK
ey, com.ibm.websphere.csi.TxCookie, com.ibm.websphere.csi.ExceptionType)
void
com.ibm.ejs.container.EJSContainer.postInvoke(com.ibm.ejs.container.EJSWrapp
er, int, com.ibm.ejs.container.EJSDeployedSupport)
void
com.capgemini.no.heh.ejbentity.EJSRemoteKonsulentHome.remove(java.lang.Objec
t)
void
com.capgemini.no.heh.ejbentity._KonsulentHome_BaseStub.remove(java.lang.Obje
ct)
void
com.capgemini.no.heh.ejbentity._KonsulentHome_Stub.remove(java.lang.Object)
void com.capgemini.no.heh.ejbsession.KonsulentAOBean.removeKonsulent(short)
void
com.capgemini.no.heh.ejbsession.EJSRemoteKonsulentAO.removeKonsulent(short)
org.omg.CORBA.portable.OutputStream
com.capgemini.no.heh.ejbsession._EJSRemoteKonsulentAO_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
Some idea?
Regards Espen Lysvik, Norway.