-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: 'Detached entity passed to persist' during merge
PostPosted: Mon Oct 23, 2017 8:06 am 
Newbie

Joined: Mon Oct 23, 2017 8:03 am
Posts: 2
After migrating hibernate from 4.3.11 to 5.1.10 and using the new hibernate-enhance-maven-plugin replacing the deprecated ant bytecode enhancement task, the following happens with an entity with OneToMany association with CascadeType.ALL.

enableLazyInitialization set to false and the test passes
enableLazyInitialization set to true and the test fails with "Detached entity passed to persist"
App worked fine with 4.3.11 version of hibernate and the old bytecode enhancement with ant task.

I can work around this by removing CascadeType.PERSIST but I have to change lot of associations and service methods for persisting a new entity.

Any help would be greatly appreciated regarding if this is a hibernate-enhance-maven-plugin bug or if there is any issue with my test?

Please find the test https://github.com/gubbes/hibernate-orm5-hibernate-enhance-maven-plugin-test


Top
 Profile  
 
 Post subject: Re: 'Detached entity passed to persist' during merge
PostPosted: Mon Oct 23, 2017 8:15 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
You need to try it with the latest 5.2.12 version and see if it works. This is the current development branch, 5.1 being frozen.

Use the JPA test case templates to replicate the issue, and if it does, then you should open a new Jira issue.


Top
 Profile  
 
 Post subject: Re: 'Detached entity passed to persist' during merge
PostPosted: Mon Oct 23, 2017 10:18 am 
Newbie

Joined: Mon Oct 23, 2017 8:03 am
Posts: 2
Hi Vlad,

Thank you for the quick response and input, and I did try it with 5.2.12 and able to replicate the issue. Created the JIRA ticket https://hibernate.atlassian.net/browse/HHH-12054.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.