Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2007, 09:27 PM
Ed Ed is offline
Senior Member
 
Join Date: Jun 2007
Posts: 110
Rep Power: 0
Ed is on a distinguished road
Default hibernate lazy=False
I need an advice
I have a rmi server where I do all about connection with hibernate
The problem was that the rmi client send to me a hibernate exception,
Finally, I found out that the "many to one" map should set "lazy=False"
the question is:
Is it risky to work like this?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 07-02-2007, 08:51 PM
Senior Member
 
Join Date: Jun 2007
Posts: 164
Rep Power: 3
Heather is on a distinguished road
Default
It isn't recommendable because if you have a lot of collections in an object
and you want to list them, you surely have to work with all the information when you really want to work with the object that you need
In this case use a querystring:
LEFT JOIN FETCH
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 08:54 PM
Senior Member
 
Join Date: Jun 2007
Posts: 119
Rep Power: 0
Peter is on a distinguished road
Default
It isn't risky.
You have to know what are you doing.
When you write "lazy=false" you are telling it that when it saves an object, saves their properties too (in your case a collection)
The potential problem is the performance
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hibernate, help me Nick15 Database 2 06-05-2008 04:39 PM
Lazy Initialization onegcr New To Java 1 08-14-2007 04:29 PM
org.hibernate.ejb.Version <clinit> INFO: Hibernate EntityManager 3.2.0.CR1 Heather Database 2 06-30-2007 04:01 PM
How can i set the table's column dragable/movable false and cell editable johnt AWT / Swing 4 05-19-2007 12:15 PM
Hibernate Shuru Database 2 05-09-2007 06:39 PM


All times are GMT +2. The time now is 07:47 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org