-->
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.  [ 7 posts ] 
Author Message
 Post subject: auto_close_session not available via JMX. Workaround?
PostPosted: Thu Jun 16, 2005 11:57 am 
Newbie

Joined: Fri Jun 25, 2004 9:05 pm
Posts: 13
auto_close_session doesn't appear to be settable via the HAR JMX bean, so if you are using the HAR deployment, how do you set that?

The Wiki never addresses how you set properties that are not part of the ones' that are accessed via the JMX console. Is that because the one's that are available are the only ones that are deemed 'correct'?

My interest is in setting auto_close_session to false, as I wish to use CMT and the HAR deployer, but wish to manage the Sessions myself.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 12:03 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/v3/re ... n-j2ee-jmx


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 12:58 pm 
Newbie

Joined: Fri Jun 25, 2004 9:05 pm
Posts: 13
christian wrote:
http://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-j2ee-jmx


Ahh, thank you! I really do appreciate it.

I was looking at the Hiberante JMX Bean, and not the HiberanteService JMX Bean.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 16, 2005 3:09 pm 
Newbie

Joined: Fri Jun 25, 2004 9:05 pm
Posts: 13
I may have been too quick on thinking this fixed my problem. After looking at it some more, it seems like there are two competeing MBeans.

There is org.hibernate.jmx.HibernateService, which is part of the Hibernate source tree, and allows the user to deploy Hibernate as a service.
Pros: exposes more configuration properties (and in my case the one I want).
Cons: requires packaging the Hibernate and dependant jars files into the deployment, as well as explicitly stating all the mapping files

There is also org.jboss.hibernate.jmx.Hibernate, which is part of the JBoss source tree, and also deployes Hibernate as a service.
Pros: No need to package Hibernate as part of your deployment and no need to explicity state which mapping files exist. Seems to be the 'supported' path for JBoss AS users
Cons: Limited number of exposed configuration properties.

So, that leads to the question: Why have both?

I would assume it is because one is AS independant, and the other is specific to JBoss. That makes sense.

However, is there a reason not to allow the JBoss-specific MBean to not have all the same configuration properties?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 17, 2005 1:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
The one in the jboss source tree operates under certain assumptions (mainly that all hibernate calls are wrapped in a JTA transaction). Thus certain things don't need to be configured.

auto_close_session is automatcially enabled in that particular mbean.

http://cvs.sourceforge.net/viewcvs.py/jboss/hibernate/src/main/org/jboss/hibernate/jmx/Hibernate.java?rev=1.12&only_with_tag=HEAD&view=auto


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 17, 2005 7:46 am 
Newbie

Joined: Fri Jun 25, 2004 9:05 pm
Posts: 13
steve wrote:
The one in the jboss source tree operates under certain assumptions (mainly that all hibernate calls are wrapped in a JTA transaction). Thus certain things don't need to be configured.

auto_close_session is automatcially enabled in that particular mbean.

http://cvs.sourceforge.net/viewcvs.py/jboss/hibernate/src/main/org/jboss/hibernate/jmx/Hibernate.java?rev=1.12&only_with_tag=HEAD&view=auto


Thanks. I figured that out last night when I downloaded the JBoss source. I did a quick build exposing that flag and it worked fine inside my app.

I guess I don't understand how it can be assumed that you will always be inside a JTA TX -- is it not considered kosher to make read-only calls to Hibernate from a servlet layer not from inside the context of a TX?

I can understand if the JBoss version is making certain assumptions, and in that case, I will work around it. I guess I am more curious now to make sure *I* am not making a fundemental design flaw, based on that assumptions tha t you have made.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 17, 2005 11:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
There is already a plethora of information regarding this question strewn about this forum and the net in general.

Basically, why do you think that performing an access outside of JTA is any slower (since thats the typical reasoning behind this question)? There is only a single scenario where that is typically the case, and that is not even (by far) the most prevelant scenario in java applications.


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