[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-314) Duplicate object in persistent bag - regression in 3.3.1 EM
Vincent Sevel (JIRA)
noreply at atlassian.com
Mon Sep 17 03:33:14 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-314?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28110 ]
Vincent Sevel commented on EJB-314:
-----------------------------------
Emmanuel, I have just checked in a shorter test case (see above).
There I have a custodian persisted to be gin with (it contains no account).
I create an account, then add it to the detached custodian (with the back pointer set; ie: cust.addAccount), and finally persist it.
before I return from the method associateNewAccountWithExistingCustodian, I print the content of the account collection and here is the duplicate :
2007-09-17 09:28:16,578 [DEBUG] com.lodh.position.custodian.entity.CustodianTest - [CustodianAccountEty#1, CustodianAccountEty#1]
I was expecting only one (since I added only one) :
2007-09-17 09:28:16,578 [DEBUG] com.lodh.position.custodian.entity.CustodianTest - [CustodianAccountEty#1]
hope that clears things up.
v.
> Duplicate object in persistent bag - regression in 3.3.1 EM
> -----------------------------------------------------------
>
> Key: EJB-314
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-314
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Components: EntityManager
> Affects Versions: 3.2.1, 3.3.1.GA
> Environment: Hibernate version: 3.2.2
> Hibernate annotations version: 3.3.0
> Hibernate em version: 3.3.1
> hsqldb 1.8.0
> Reporter: Vincent Sevel
> Attachments: CustodianEty.java, mini_test_case.txt, sources.txt, test_code_between_open_close.txt
>
>
> Doing a persist on a new object that has been added to an unitialized persistent bag, with lead to this collection containing 2 times the same new instance.
> However, if the collection is forced to be initialized before the persist, then it behaves correctly.
> This was working in 3.2.1, not anymore in 3.3.1.
> Look at the method findOrCreateCustodianAccount in test_code_between_open_close.txt and the XXX comments.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list