Heather,
What release/revision of OpenJPA are you using?  There was a semi-recent
situation with the ordering of inserts in our statement batching support
that you may be running into.  OPENJPA-817 (
https://issues.apache.org/jira/browse/OPENJPA-817) documents the problem I
am thinking of.  Besides the code fix, you could probably test whether this
statement batch ordering is your problem or not by turning off the batching
support.

<property name="openjpa.jdbc.DBDictionary" value="batchLimit=0"/>

Hope this helps with narrowing down the problem.

Kevin

On Fri, Jan 30, 2009 at 12:23 PM, Heather Sterling <[email protected]>wrote:

>
>
> Hi,
>
> I am experiencing some weird behavior regarding the insertion order for
> inherited classes.  I am using the join table strategy and some of the time
> it inserts the superclass first, while other times it inserts the subclass
> first (thus resulting in an exception).  It's completely random, with the
> correct sequence happening maybe 25% of the time.
>
> Any ideas?
>
> Here's the gist of my classes......
>
> Superclass:
>
> @Entity(name="ManagedElement")
> @Inheritance(strategy=InheritanceType.JOINED)
> @Table(name = "DCM_OBJECT")
> public abstract class JPAManagedElement extends JPABaseClass implements
> Serializable {
>
>      @Id
>    @GeneratedValue
>    @Column(name="id", nullable = false)
>      long id;
>
>
> Subclass:
>
>
> @Entity(name="SoftwareModule")
> @Table(name="SOFTWARE_MODULE")
> @PrimaryKeyJoinColumn(name="MODULE_ID", referencedColumnName="id")
> @EntityListeners({ JPAGuidGenerator.class })
> public class JPASoftwareModule extends JPAManagedElement implements
> Serializable {
>
>
> Heather Sterling
> Systems Management Development
> Phone:  919-254-7163 T/L: 444-7163
> Cell: 919-423-3143
> Email: [email protected]

Reply via email to