users@glassfish.java.net

Re: JMS Topic to MDB to EJB to JPA - Data Integrity/Insertion Problems

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Apr 2008 15:15:55 PDT

AcknowledgeMode is set to Auto-acknowledge

The primary key is a composite key of values contained within the data that ensure uniqueness, so Contact has an @EmbededId of ContactPK. It isnt an issue of identity since when I slow the rate of injection down to ~5 objects/second or slower, everything works fine. Greater than 10 objects/second placed onto the Topic is an almost guarantee of problems.

The app server is not spread across multiple machines/jvm's, so EntityManager.find() shouldn't have a problem in the context you described. Regardless, I should never be encountering this situation anyways since every entity in the data is truly unique. Hence why I believe the MDB is pulling the same message off the topic multiple times and trying to persist it, with every dupe beyond the first encountering problems.
[Message sent by forum member 'jamesdh' (jamesdh)]

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