-->
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.  [ 2 posts ] 
Author Message
 Post subject: A possible bug of <any> mapping?
PostPosted: Mon Jul 31, 2006 2:13 am 
Newbie

Joined: Fri Sep 16, 2005 3:08 am
Posts: 15
Hello, all

It seems I find a bug of <any> mapping. The bug occurs under such situations:

    -- class Box has a property "basket" which is type of Object and can contain ANY Basket (AppleBasket, GrapeBasket, ......)
    -- class AppleBasket has a set of Apple objects (one-to-many), and this set use lazy loading

and:

    -- open a transaction
    -- create a Box instance
    -- create some Apple instances
    -- create an AppleBasket instance
    -- put Apple instances into AppleBasket
    -- put AppleBasket into the Box
    -- save instances
    -- commit the transaction
    -- now all operations succeed

and:

    -- open a transaction
    -- create a Box instance
    -- load one existing AppleBasket instance (Note here that no apples are loaded because of lazy loading)
    -- put AppleBasket into the Box
    -- save instances
    -- commit the transaction
    -- now you get errors:

an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: collection [test.AppleBasket.apples] was not processed by flush()


However, before we put AppleBasket into the Box, if we explicitly load the apples with:
Code:
basket.getApples();

the above operations can succeed.


Is this a bug? Or after the basket is loaded I have to de-lazy-load all properties of basket explicitly? And should I report this bug (if it is a bug) to Hibernate developers team?

Thank you for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 31, 2006 11:08 am 
Newbie

Joined: Fri Sep 16, 2005 3:08 am
Posts: 15
Any information? Please help me!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 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.