Hi, again!
Here's an additional info:
- during short transaction it aborts with stated Exception when calling
the setter-method of object
- during long transaction it aborts with commit
Maybe this helps
Greetings
- Thorsten -
-----Urspr�ngliche Nachricht-----
Von: Adam Esterline [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 30. August 2001 11:55
An: [EMAIL PROTECTED]
Betreff: Re: [castor-dev] Unable to update an object ...
Are you doing the update during the same transaction as the load? Is
yes,
I think that the update method is designed for long transactions
(spanning
multiple transactions). If you want to update the Object in the same
transaction, just commit the current transaction.
I hope that this helps.
Adam
----- Original Message -----
From: "Koller, Thorsten" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 30, 2001 4:25 AM
Subject: [castor-dev] Unable to update an object ...
> Hi all!
>
> I do not succeed in updating an object while acting as follows:
>
> _db.begin ();
> AnObjectType anObject = (AnObjectType) _load.load
> (AnObjectType.class, new Integer (id) );
> _db.commit ();
>
> This works fine, at least I receive one object of type AnObjectType.
>
> Then, within the same method I try to update as follows:
>
> anObject.setProperty1 ("bla");
> _db.begin ();
> _db.update (anObject);
> _db.commit ();
>
> This results in a Exception:
>
> "org.exolab.castor.jdo.ObjectModifiedException: Transaction
> aborted: Object of type AnObjectType
> with identity id has been modified by a concurrent transaction".
>
> If I try to update within the first Transaction after load, the same
> happens.
> What goes wrong here?
>
> Thanks for advices in advance!
> - Thorsten -
>
> -----------------------------------------------------------
> 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
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev