wood burning stoves
The moose likes Object Relational Mapping and the fly likes handling object restore on rollback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "handling object restore on rollback" Watch "handling object restore on rollback" New topic

handling object restore on rollback

fred funston

Joined: Feb 21, 2004
Posts: 1
When you delete a user, for example, a large number of
objects that refer to the user will need to be updated also.
This all happens in a transaction. The objects will
get updated in memory before the database transaction
is committed.
How do you handle "restoring" the in memory objects when a
rollback in the database occurs?
The transaction context does not include objects so there
is no equivalent way of undoing all the changes that have
been made to objects.
The realistic solutions i can think of:
* restart the system so it reloads from the database
* don't use OO over relational
* map tables and objects 1-1, which defeats the purpose
Is there a better way?
Erik Bengtson
Ranch Hand

Joined: Dec 06, 2003
Posts: 90
a JDO implementation will restore your persistent objects on a simple configuration:
I agree. Here's the link: http://aspose.com/file-tools
subject: handling object restore on rollback
It's not a secret anymore!