-->
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: Dynamically changing hibernate.show_sql property
PostPosted: Wed Sep 17, 2008 6:01 am 
Newbie

Joined: Wed Sep 17, 2008 3:55 am
Posts: 1
Hi All,

How i can change hibernate.show_sql property programatically without bring down the ApplicationServer.
The requirement is hibernate.show_sql property could be changing without shutting down the server.

Here the hibernate configuration file where hibernate.show_sql property value is hardcoded to "true".

<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.max_fetch_depth">10</prop>
<prop key="hibernate.default_schema">MyApplication</prop>
<prop key="hibernate.format_sql">false</prop>
<prop key="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</prop>
<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>

<prop key="hibernate.cache.use_query_cache">false</prop>
<prop key="hibernate.cache.use_second_level_cache">false</prop>
<prop key="hibernate.use_sql_comments">false</prop>
<prop key="hibernate.default_schema">MySchema</prop>\
</props>
</property>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 17, 2008 3:48 pm 
Newbie

Joined: Wed Jul 25, 2007 6:33 pm
Posts: 9
See this: http://hibernar.org/foro/viewtopic.php?f=4&t=4

You can dynamically change the log4j thresholds to turn on/off this information, e.g. by doing this:

Logger.getLogger("org.hibernate.SQL").setThreshold(Level.INFO);


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.