Sunit,
which RDBMS are you using ? If you happen to be using mySQL, can you please post the
mapping for RemovalCandidate ?
Thanks
Werner
On Tue, 1 Jun 2004 20:56:53 -0700, Kavathekar, Sunit wrote:
>
>I have a working castor intall which I can use to read and insert objects. When I try
>any updates to any object at all, I get an ObjectModifiedException
as follows:
>
>6871 [main] ERROR
>com.amazon.invhealth.disposition.dispsitionchannels.marketplace.tests.TestMarketplaceDataManipulator
> - Persistence
Exception in executeDispositionDecision from JDO layer
>org.exolab.castor.jdo.ObjectModifiedException: Transaction aborted: Object of type
>com.amazon.invhealth.disposition.dataentities.RemovalCandidate
with identity 1,335,206,261 has been modified by a concurrent transaction (cache entry
is different from database row)
> at org.exolab.castor.jdo.engine.SQLEngine.store(SQLEngine.java:880)
> at org.exolab.castor.persist.ClassMolder.store(ClassMolder.java:1609)
> at org.exolab.castor.persist.LockEngine.store(LockEngine.java:750)
> at
> org.exolab.castor.persist.TransactionContext.prepare(TransactionContext.java:1540)
> at org.exolab.castor.jdo.engine.DatabaseImpl.commit(DatabaseImpl.java:512)
> at
>
>
>The code is simple enough - load an object and modify it then commit.
>
> try {
>
> // Define the JDO object
> db = MarketplaceChannelDataAccessor._db;
> // Begin a transaction
> db.begin();
> // Do something
> RemovalCandidate rc =
> (RemovalCandidate)db.load(RemovalCandidate.class,new Long(1335206261L));
> rc.setQuantity(0);
> rc.setOriginalBinItemQuantity(0);
> rc.setRefundAmount(0);
> rc.setRemovalReasonNotes("Test for disposition service");
>
> db.commit();
>
> } catch (PersistenceException e) {
> Logger.getLogger(this.getClass()).error("Persistence Exception in
> executeDispositionDecision from JDO layer", e);
> try {
> //dbConn.rollback();
> db.rollback();
> } catch (PersistenceException eSQL) {
> Logger.getLogger(this.getClass()).error("Persistence Exception during
> txn rollback from JDO layer", eSQL);
> }
> }
>
>
>
>Any help in this matter will be greatly appreciated.
>
>
>Thanks,
>Sunit
>
>Thanks,
>Sunit
>
>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user