This one time, at band camp, Smartifacts said:
S>I am using Castor-JDO for database operations.
S>I am trying to update an object. When I retreive an object and try to update it, it
throws the following exception:
S>
S>java.lang.IllegalArgumentException: A master object that involves in a long
transaction must be a TimeStampable!
S> at org.exolab.castor.persist.ClassMolder.update(ClassMolder.java:1727)
S> at org.exolab.castor.persist.LockEngine.update(LockEngine.java:638)
S> at
org.exolab.castor.persist.TransactionContext.markUpdate(TransactionContext.java:920)
S> at org.exolab.castor.persist.TransactionContext.update(TransactionContext.java:991)
S> at org.exolab.castor.jdo.engine.DatabaseImpl.update(DatabaseImpl.java:353)
S> at com.smartifacts.narmada.CastorTestClient.updateRecord(CastorTestClient.java:155)
S> at com.smartifacts.narmada.CastorTestClient.main(CastorTestClient.java:222)
S>
S>Here it is the code which I am using:
S>
S> try{
S> db = jdo.getDatabase();
S>
S> db.begin();
S> String id="3";
S> Test_table x = (Test_table)db.load(Test_table.class, id );
S> db.commit();
S>
S> x.setId("2");
S> db.setAutoStore(true);
S> db.begin();
S> db.update(x);
S> db.commit();
S>
S> db.close();
S> }
S> catch(Exception e){
S> e.printStackTrace();
S> }
S>
S>What could have been wrong with this? Can somebody help me on this.
Veeru,
In order to make use of Castor's long transactions, all objects
involved must implement the org.exolab.castor.jdo.Timestampable
interface. See the following for more information:
http://www.castor.org/long-transact.html
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev