Hi Mark

Mark Clarke wrote:
Hi thee people,

We retrieve a bunch of objects from the database and materialise them as
objects which are part of a collection. The collection is used to
populate a grid.

Users can edit the grid and the objects are updated for such edits. We
then pass the collection back to a save routine when the user has
finished and iterate thru the list and save each object. This has the
unfortunate effect of sending sql update statements to the db for each
object even if there has been no changes to the objects data. Is there
no way in ojb to detect which objects have had state changes that need
to be persisted and then only save thoughs?

Depends!


The OJB PB does not track the state of objects. PB is a low level api and assumes that the user is reponsible for tracking which objects were changed and to call pb.store only on those objects.

OJB/ODMG and OJB/JDO have an instance lifecylce model that allows to track the state of an object. Both layers only execute updates for objects that were changed within the current transaction.


I am hoping for a simple function built into ojb. Otherwise I will have to create a change flag in each object. Most other things, like optimistic locking, are so easy and I hope that this is as well.

It's for free in OJB/ODMG and OJB/JDO, but not implemented in PB.


Also does anyone know if there is a way to get ojb to keep its original
values and only the updated values of an object? This will facilitate
more sophisitcated optimistic locking where users edit different fields
etc.

that's also possible with OJB/ODMG


cheers Thomas


Thanks Mark



---------------------------------------------------------------------
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]



Reply via email to