|
I used Castor+Tomcat 4.0 and Struts.
I can udpate a record once,
when I try to update it another time, I get the
following exception.
org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object
of type be.wavenet.db.Signa with identity 5 has been modified by a concurrent
transaction
What is wrong?
Can I use Castor inside tomcat without JNDI (like I
do I my servlet) ???
thanks
jean-noel
here is the code from my servlet
JDO
_jdo;
_jdo = new JDO(); FileOutputStream fosCastorLog = new
FileOutputStream("castor.log");
PrintWriter pwCastorLog = new PrintWriter(fosCastorLog); _jdo.setLogWriter( pwCastorLog ); _jdo.setConfiguration("database.xml");
_jdo.setDatabaseName( "wavenet" ); try{ Database db; db = _jdo.getDatabase(); db.begin(); Signa signa = (Signa) db.load(Class.forName("be.wavenet.db.Signa"),new Integer(signaForm.getSigna_id()),Database.Exclusive); signa.setEmail([EMAIL PROTECTED]); ... db.commit();
db.close(); } catch (Exception e){ errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("errors.castor",e)); } String l_result = "success";
if (!errors.empty()){ System.out.println ("!errors.empty()"); saveErrors(request, errors); } return mapping.findForward(l_result);
|
