users@glassfish.java.net

Re: Persistence / JPA / TopLink: lost updates

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Feb 2008 08:18:18 PST

The reason I need the update to be executed is that there is an update trigger in the database, which needs to be fired. This trigger basically copies the data to a history table before it is deleted.

So, of course I could commit after the update, but what if the transaction rolls back later on? Bye bye ACID and hello phantom data in the history table :)

Even if we disregard external effects, such as database triggers, it would be very unwise of the container to simply skip an update before deletion. It is very conceivable that an update could change the data in a way that affects the outcome of the delete.

In any case, why does it work with user transactions? Under what conditions are updates skipped?

Ulrich
[Message sent by forum member 'ulim' (ulim)]

http://forums.java.net/jive/thread.jspa?messageID=257021