This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
Visual Age for java version 4.0, EJB,remove from DB
Posted by Espen Lysvik on February 12, 2002 at 6:35 AM
Hi! I am trying to delete a row in a DB2 table. Have mapped the Entity beans against the DB tables, and made several SessionBeans. It seems that version 3.5 and 4.0 are working different concerning removing entries from the DB tables? In my SessionBean I have the following. public void removeKonsulent(short ansnr) throws 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 Konsulent kons = konshome.findByPrimaryKey(new KonsulentKey(ansnr)); konshome.remove(kons); } catch(Exception ex){ throw new Exception(ex.getMessage()); } } And I get this errormessage: com.ibm.ejs.container.UncheckedException: ; nested exception is: java.lang.Exception: CORBA TRANSACTION_ROLLEDBACK 0 No; nested exception is: 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 ++++++++++ Regards Espen Lysvik
Replies:
|