-->
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.  [ 6 posts ] 
Author Message
 Post subject: how to set auto_close=false with har & jboss-4.0.1
PostPosted: Tue May 10, 2005 2:46 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
I don't see any properties that allow me to set auto_close to false and I rely heavily on lazy loading until the end of the request cycle in a servlet application.

Any transaction that is completed currently closes the session. How can I turn auto_close off using the hibernate3 har in jboss-4.0.2? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 6:28 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Sorry, I entered the wrong topic subject... it should show jboss-4.0.2. I would really appreciate any help. Thanks.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 6:50 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Also, I have tried setting this system property:

hibernate.transaction.auto_close_session=false

which does not work.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 7:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Sure, don't use SessionFactory.getCurrentSession() nor the HARDeployer.

The org.jboss.hibernate.jmx.Hibernate MBean always sets this property to true. SessionFactory.getCurrentSession() always places the built Session into auto-close mode.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 9:14 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Thank you very much, Steve. Is there, by any chance, a way I could use the HARDeployer and not have it set auto commit to true? I assume that it is strange to want what I am asking for. Why would you not want to be able to set this property... am I doing something wrong or not using sessions in the proper manner?

I always close my sessions at the end of the request by setting them in a ThreadLocal so I can use the lazy loading functionality in a Velocity transformation. How would you accomplish this using the HARDeployer? Do you have any suggestions?

Thank you very much for your time.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 9:16 pm 
Beginner
Beginner

Joined: Mon May 24, 2004 7:39 pm
Posts: 37
Location: Charlotte
Or, is there I can manually change this setting on the session after I retrieve it from the session factory? Thanks.

Joe


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