users@glassfish.java.net

Re: Problem with insert

From: <glassfish_at_javadesktop.org>
Date: Mon, 16 Jun 2008 06:46:50 PDT

Hello,

You seem to be using OpenJPA, so you may want to post in one of their forums to get information on how it works and what the error means. From how TopLink Essentials and EclipseLink work though, you cannot try to insert two entities with the same primary key value. A new MainClass entity would result in an insert to the MAIN_TABLE, as you seem to expect. But because you have selected Joined inheritance, a new SubtableClass entity will result in an insert to both the MAIN_TABLE and SUBTABLE tables. Since the new SubtableClass and MainClass share an id, this means there are likely 2 inserts to the MAIN_TABLE.

Best Regards,
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

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