Community
Participate
Working Groups
Hello, My eclipseLink version is 2.1.3, im using both @ManyToOne and @JoinTable to mapping this situation: @ManyToOne(fetch = FetchType.EAGER) @JoinTable(name = "TABLE_USER_ADDRESS", joinColumns = @JoinColumn(name = "USER_ID", referencedColumnName = "USERID"), inverseJoinColumns = @JoinColumn(name = "ADDR_ID", referencedColumnName = "ADDRESSID")) private Address address; When remove an User, jpa try to remove the Address associated. Although the address is associated with more users (hence ManyToOne). Forum post: http://www.eclipse.org/forums/index.php/t/440677/ The SQL log: [EL Fine]: 2012-11-28 09:19:30.276--ServerSession(219730313)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--SELECT USERID FROM USER WHERE (USERID = ?) bind => [administrationUser] [EL Fine]: 2012-11-28 09:19:30.278--ServerSession(219730313)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--SELECT t1.USERID FROM TABLE_USER_ADDRESS t0, USER t1 WHERE ((t0.USER_ID = ?) AND (t1.USERID = t0.USER_ID)) bind => [administrationUser] [EL Fine]: 2012-11-28 09:19:30.283--ClientSession(1080497174)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--DELETE FROM TABLE_USER_ADDRESS WHERE (USER_ID = ?) bind => [administrationUser] [EL Fine]: 2012-11-28 09:19:30.287--ClientSession(1080497174)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--DELETE FROM USER WHERE (USER_USERGROUP = ?) bind => [administrationUser] [EL Fine]: 2012-11-28 09:19:30.308--ServerSession(219730313)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--SELECT ADDRID FROM ADDRESS WHERE (ADDRID = ?) bind => [addrIDUserAdministration] [EL Fine]: 2012-11-28 09:19:30.31--ClientSession(909751202)--Connection(764103883)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--DELETE FROM ADDRESS WHERE (ADDRID = ?) bind => [addrIDUserAdministration] [EL Fine]: 2012-11-28 09:19:30.391--ClientSession(909751202)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--SELECT 1 FROM DUAL [EL Warning]: 2012-11-28 09:19:30.411--UnitOfWork(1335606662)--Thread(Thread[DistributedCache:MetadataCache,10,Cluster])--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLIntegrityConstraintViolationException: ORA-02292: integrity constraint (USERADDR_TABLE_USER_ADDRESSSRID) violated - child record found Error Code: 2292 Call: DELETE FROM ADDRESS WHERE (ADDRID = ?) bind => [addrIDUserAdministration] Query: DeleteObjectQuery(Address{key=AddressKey{key=addrIDUserAdministration}})
Does it still fail in 2.4.0?
(In reply to comment #1) > Does it still fail in 2.4.0? Sorry, I have not been able to check it.
2.4.x is the earliest stream we are likely to patch.
Setting target and priority. See the following page for the meanings of these fields: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines Community: Please vote for this bug if it is important to you. Votes are one of the main criteria we use to determine which bugs to fix next.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink