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 14:44:13 PDT

What is the acknowledge-mode of MDB?

Is it Auto-acknowledge or Dups-ok-acknowledge? Or do you manually acknowledge reception of jms message in mdb (if you use bean managed transaction in mdb and not container managed)?

Or add some debug code to print the id when this exception occurs.
How is primary key of Contact generated? Is it from a sequence?

Btw when you use Toplink persistence provider, em.find by default might not always be able to see updates to table that were done by some other server. As a result em.find will return null, but em.persist will throw an exception. You cannot refresh the table using em, only entity, but you don't have it. I use:
<properties>
      <property name="toplink.cache.shared.default" value="false"/>
</properties>

In the <persistence-unit element in persistence.xml to avoid that problem.
[Message sent by forum member 'jarol1' (jarol1)]

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