Hi Bruce,

Yes, I read that link, and have been implementing the Timestampable
interface.

I got this problem when I use cache-type="count-limited". Just solved this
by changing it to "unlimited". I don't know why this is a solution, but it
works!

However, if I use MS SQL server, I passed the above error, then got
"org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object
of type esb.interfaces.RoleData with identity admin has been modified by a
concurrent transaction" when Castor called store(). I'm sure that I was the
only user who modified the data!

I've datetime fields in that object, would this causes the problem?

When I use MySQL, this problem doesn't exist! Is this a well-known bug that
needs special handling?

Thanks

Thomas Phan

www.entersys.com
An Enterprise ERP & CRM Solution Provider using the J2EE & .NET technology
----- Original Message -----
From: "Bruce Snyder" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 28, 2002 12:05 AM
Subject: Re: [castor-dev] Timestamp mismatched while the Castor object holds
the same timeStamp value between the 2 tranactions


> This one time, at band camp, Thomas Phan said:
>
> TP>  public Object findByPrimaryKey(Class type, Object identity) throws
> TP>Exception {
> TP>    Database db = null;
> TP>    try {
> TP>      db = jdo.getDatabase();
> TP>      return db.load(type, identity, Database.ReadOnly);
> TP>    }
> TP>    catch (org.exolab.castor.jdo.ObjectNotFoundException onfe) { return
> TP>null; }
> TP>catch (Exception e) { e.printStackTrace(); return null; }
> TP>    finally {
> TP>      try { if (db != null) db.close(); }
> TP>      catch (PersistenceException pe) {}
> TP>    }
> TP>  }
> TP>
> TP>  public void update(Object data) throws Exception {
> TP>    Database db = null;
> TP>    try {
> TP>      db = jdo.getDatabase();
> TP>      db.update(data);
> TP>    }
> TP>catch (Exception e) { e.printStackTrace(); }
> TP>    finally {
> TP>      try{ if (db != null) db.close(); }
> TP>      catch (PersistenceException pe) {}
> TP>    }
> TP>  }
>
> Thomas,
>
> You should be using Castor's long transactions with your scenario.
> This means that objects should implement the Timestampable interface.
> Please see:
>
>     http://www.castor.org/long-transact.html
>
> I'm not sure if this is the problem, but it's a place to start
> looking.
>
> 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

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to