-->
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.  [ 1 post ] 
Author Message
 Post subject: subselect fetch ignored after commit but before close (bug?)
PostPosted: Sun Nov 16, 2008 7:13 am 
Newbie

Joined: Sun Nov 16, 2008 7:01 am
Posts: 2
Hi all,

Java persistence with Hibernate states that "a subselect is only remembered by hibernate for a particular Session". Despite this I noticed that after session.getTransaction().commit() the subselect fetch is disabled, even if the session is not yet closed. For example:

1) This works

parents = ....
parents.get(0).getChildren().get(0) <-- children for all parents are fetched
session.getTransaction().commit()
session.close()

2) This doesn't work

parents = ....
session.getTransaction().commit()
parents.get(0).getChildren().get(0) <-- only children for parent 0 are fetched
session.close()

This behavior is particularly annoying because transactions are commited at the services layer and after that the view can't take advantage of subselect optimizations anymore.

Is this expected or should I file an issue into the jira?

Regards
-Carlos


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.