| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#11
| |||
| |||
| It looks like I have run into something similar. I ran my test multiple times with 3 distinct results. Please see the attachment. My observation is that : Sometimes 1. Insert attempt is made in the Child table before the parent. 2. Insert attempt is made in the Secondary table before the primary. 3. The happy path. The Model: @Entity @Table(name = "PARTY") @DiscriminatorColumn(name = "PARTY_CLASS_CD") @SecondaryTable(name = "PARTY_TYPE_INSTANCE", pkJoinColumns = @PrimaryKeyJoinColumn(name = "PARTY_ID", referencedColumnName = "PARTY_ID")) @Inheritance(strategy = InheritanceType.JOINED) public class Customer extends AuditInfo {...} @Entity @DiscriminatorValue("PER") @Table(name = "PERSON") @PrimaryKeyJoinColumn(name = "PARTY_ID", referencedColumnName = "PARTY_ID") public class Person extends Customer {...} Client Code: EntityManager em = emf.createEntityManager(); EntityTransaction tx = em.getTransaction(); tx.begin(); Person org = new Person(); ... ... em.persist((Customer) per); tx.commit(); em.close(); http://n2.nabble.com/file/n790496/log.txt log.txt Pinaki Poddar wrote: > > Hi, > Please post a reproducible JUnit (not DBUnit) test with all required > artifacts (entities, mapping annotations/descriptors, persistence.xml) > with assertions to demonstrate the exact nature of failure. > > Then we can confirm whether the reported observation is a OpenJPA > limitation/bug or not. > > -- View this message in context: http://n2.nabble.com/problem-when-pe...91p790496.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
|
#12
| |||
| |||
| I have attached the Schema, Java Sources and the build file. (libraries are not included) Source files: OpenJPAIssue\jpa\src XML/Properties: OpenJPAIssue\jpa\etc Database Schema: OpenJPAIssue\schema.sql Client: OpenJPAIssue\jpa\src\client\JPAHelloWorld Ant Log File: OpenJPAIssue\ant_log.txt (this will have details of the execution environment) The build scripts "run" target invokes the client. When I run it a few times in succession, I find that it fails and succeeds as described in my earlier post. http://n2.nabble.com/file/n838052/OpenJPAIssue.zip OpenJPAIssue.zip Pinaki Poddar wrote: > > Hi, > Please post a reproducible JUnit (not DBUnit) test with all required > artifacts (entities, mapping annotations/descriptors, persistence.xml) > with assertions to demonstrate the exact nature of failure. > > Then we can confirm whether the reported observation is a OpenJPA > limitation/bug or not. > > -- View this message in context: http://n2.nabble.com/problem-when-pe...91p838052.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.