users@glassfish.java.net

TopLink/EclipseLink and triggers

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Jul 2008 15:19:30 PDT

Could someone here comment on the approach taken at http://technology.amis.nl/blog/?p=1363

The overall problem is how to ensure that after an insert or an update the state of the entity is augmented with any state provided or altered by the database (such as by a trigger).

Technically the approach in the article referenced is not portable because the EntityListener invokes a method (refresh()) on an EntityManager (it is also highly suspect as to how the article provides the EntityManager to the EntityListener).

I'm wondering what the Glassfish community's approach has been. Do people just do either a persist() followed by a flush() and a refresh() in all cases where they need data to be incorporated from a trigger invocation? Or is there a simpler way that I'm overlooking?

Thanks as always for the great assistance provided here. This really is a great, respectful forum (a rarity, it seems, these days).

Best,
Laird
[Message sent by forum member 'ljnelson' (ljnelson)]

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