Results 1 to 3 of 3
  1. #1
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    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?

  2. #2
    Heather is offline Senior Member
    Join Date
    Jun 2007
    Posts
    164
    Rep Power
    8

    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

  3. #3
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    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

Similar Threads

  1. Hibernate, help me
    By Nick15 in forum JDBC
    Replies: 2
    Last Post: 06-05-2008, 03:39 PM
  2. Lazy Initialization
    By onegcr in forum New To Java
    Replies: 1
    Last Post: 08-14-2007, 03:29 PM
  3. Replies: 2
    Last Post: 06-30-2007, 03:01 PM
  4. Replies: 4
    Last Post: 05-19-2007, 11:15 AM
  5. Hibernate
    By Shuru in forum JDBC
    Replies: 2
    Last Post: 05-09-2007, 05:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •