users@glassfish.java.net

Duplicate Sequence Generator Rows During Deployment

From: <glassfish_at_javadesktop.org>
Date: Sat, 20 Feb 2010 20:04:14 PST

GlassFish v2.1.1
EcipseLink v2.0.1

We have <table-generator> tags defined in our orm.xml. EclipseLink creates rows in the sequence generator table during deployment of the EAR file on start up. When GlassFish is shutdown and restarted, the sequence tables remain the same as expected, since the EAR file has not changed.

However, if the EAR file is redeployed for any reason, we get duplicate rows in the sequence generator table i.e. an extra duplicate row for each deployment and we end up with multiple rows with the same pk-column-value and initial-value, even if an initial-value previously existed in that table. This was discovered as a result of duplicate key exceptions occurring later on while using the application.

As far as I can tell that seems like a bug, and the only way out is to manually fix the sequence generator table after each deployment, and depending on the application usage, there may not be an opportunity to do that before the duplicate key is noticed.

Joe
[Message sent by forum member 'teknomad' (joe.isaac_at_tolven.org)]

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