hi gerhard,
this is eventually my fault. in PBImpl#storeCollection i call afterStore only if auto-update is set:
.... // BRJ: only when auto-update = object (CASCADE_OBJECT) // if ((cod.getCascadingStore() == ObjectReferenceDescriptor.CASCADE_OBJECT) && (referencedObjects instanceof ManageableCollection)) { ((ManageableCollection) referencedObjects).afterStore(this); }
odmg requires the auto-settings to be false, so afterStore is _not_ called.
this change was introduced on july 26. actually i do not know, whether we should go back to the old solution ???
jakob
Jakob Braeuchi schrieb:
hi gerhard,
i marked the removed object as deletable, then it worked:
tx.begin(); //************************************* tx.lock(fetchedGat, Transaction.WRITE); // Remove collection object tx.markDelete(fetchedGat.getCollectiblesC().remove(0)); //************************************* tx.commit();
jakob
Jakob Braeuchi schrieb:
hi gerhard,
afterStore() is not called when using odmg (it is for pb-api !). i'm not an odmg-expert, so i do not know if it's an error or if there should be a different mechanism to remove those elements.
jakob
Gerhard Grosse schrieb:
Hi,
we are trying to upgrade our OJB version from RC5 to 1.0.1. We are using the ODMG API.
In RC5, when removing items from a collection of a write-locked object, the transaction commit deleted the removed items from the database. This does not seem happen any more in v1.0.1. All that is sent to the DB is an (unnecessary) SQL UPDATE on the locked object that actually does not change anything. Debugging showed that the collection class is a materialized ListProxy holding a RemovalAwareCollection (as expected). Also as expected, the allObjectsToBeRemoved member of this RemovableAwareCollection contains the items to be removed. However the items do not get removed during the transaction commit, and after commit the allObjectsToBeRemoved member still contains the same items. We also tried write-locking all collection items and doing a flush at various points, but no luck.
How should we remove items from a collection with ODMG in OJB 1.0.1?
Thanks for any help! Gerhard
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]