-->
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: Accessing lazily loaded objects in readonly transactions
PostPosted: Fri Aug 06, 2010 2:35 pm 
Newbie

Joined: Wed Apr 28, 2010 2:41 am
Posts: 3
Hi,

We are using Hibernate 3.3 with Spring 2.0. For methods which just retrieve data, we want to mark them as just read only transactions - because Hibernate always flushes after a transaction and flushing is taking a lot of time (and the application to too huge now to manage the flush mode now :) ). We tried annotating these methods with the following annotation :

Code:
@Transactional(propagation=Propagation.NOT_SUPPORTED,readonly=true)


After execution, on referencing objects which are mapped to be lazily loaded, the application fails with a "no session" error. We also tried Propagation.SUPPORTS, Propagation.REQUIRED. It does not help.

Any ideas as to how to do this ?


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