Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to prevent lazy initialization on a proxy

 
Didier Varon
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have two entities (EntityA, EntityB), linked this way:



In my process I load a EntityB by getting proxies as follows:


Then I create an EnittyA



I do this for thousands of records, and when I persist those EntityA objects, Hibernate tries to initialize the proxies, I can see hibernate logging
Hibernate: /* load com.somecompany.bean.EnitityB */


Is there any way to let hibernate know that I don't want those proxies to be initialized?

Many thanks
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!