|
Hi,
I am using Castor-JDO for database
operations.
I am trying to update an object. When
I retreive an object and try to update it, it throws the following
exception:
java.lang.IllegalArgumentException: A master object
that involves in a long transaction must be a TimeStampable!
at
org.exolab.castor.persist.ClassMolder.update(ClassMolder.java:1727)
at
org.exolab.castor.persist.LockEngine.update(LockEngine.java:638)
at
org.exolab.castor.persist.TransactionContext.markUpdate(TransactionContext.java:920)
at
org.exolab.castor.persist.TransactionContext.update(TransactionContext.java:991)
at
org.exolab.castor.jdo.engine.DatabaseImpl.update(DatabaseImpl.java:353)
at
com.smartifacts.narmada.CastorTestClient.updateRecord(CastorTestClient.java:155)
at
com.smartifacts.narmada.CastorTestClient.main(CastorTestClient.java:222)
Here it is the code which I am using:
try{
db = jdo.getDatabase();
db.begin();
String id="3"; Test_table x = (Test_table)db.load(Test_table.class, id ); db.commit(); x.setId("2");
db.setAutoStore(true); db.begin(); db.update(x); db.commit(); db.close();
}
catch(Exception e){ e.printStackTrace(); } What could have been wrong with this? Can somebody
help me on this.
Thanks
Veeru.
|
