Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Bytecode Enhancement - run vs debug
PostPosted: Tue Oct 10, 2017 5:04 am 
Newbie

Joined: Thu Aug 03, 2017 9:25 am
Posts: 6
I am using Hibernate 5.2.11 with Bytecode Enhancement.
All my entites are with @Proxy(lazy = false) and all my to-one relationships with @LazyToOne(LazyToOneOption.NO_PROXY).
In addition to that, to preserve the business logic of the system (we are migrating from Kodo to Hibernate) I needed to add to every @ManyToOne annotation CascadeType.PERSIST option.
It sometimes causes execution of the
Code:
org.hibernate.engine.internal.AbstractEntityEntry#isNullifiable
which ends up in the first condition
Code:
getStatus() == Status.SAVING

For some days I have been trying to provide a test case that reproduces the issue but I found it very hard to create, because when I am debugging the execution flow of cascading persist operation I have different result than when running the program in a normal way. When debugging line after line I reach the condition above and a field value becomes null (so the insert value does) but when running the test in a normal way, everything is okay.
Do you have any idea how to deal with it and why is this happening that I got different results with debug and without it?


Top
 Profile  
 
 Post subject: Re: Bytecode Enhancement - run vs debug
PostPosted: Wed Oct 11, 2017 9:16 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1515
The debug has an Inspector section which triggers the Proxy initialization. The only way to test this kind of issues is with Unit Tests, not via debugging.

_________________
If you liked my answer, you are going to love my High-Performance Java Persistence book and my blog as well.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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.