-->
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.  [ 3 posts ] 
Author Message
 Post subject: SQL output in console?
PostPosted: Fri Jul 21, 2006 8:32 am 
Regular
Regular

Joined: Mon May 22, 2006 8:32 am
Posts: 67
Hi everybody,

i 've got the following configuration properties in mycfg.xml. When i persist an object to the database i expect to see some sql output in my console? Is that a correct expectation?

Code:
<property name="hibernate.show_sql">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>

What i am trying is to see why my code does not insert a new record to the database (Oracle 9i).

Code:
public void persist(Rqs transientInstance) {
      log.debug("persisting Rqs instance");
      /**
       * ToDo
       */
      log.setLevel(Level.DEBUG);
      Transaction tx = null;
      try {
         tx = getCurrentSession().beginTransaction();
         getCurrentSession().save(transientInstance);//persist(transientInstance);
         tx.commit();
         log.debug("persist successful");
      } catch (RuntimeException re) {
         log.error("persist failed", re);
         if(tx != null)
            tx.rollback();
         throw re;
      }
      finally{
         getCurrentSession().close();
      }
   }


Regards,

ak


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 9:18 am 
Expert
Expert

Joined: Tue Apr 25, 2006 12:04 pm
Posts: 260
Configure your log4j.properties to see the SQL information in your console. For example of log4j.properties see "HIBERNATE_HOME/etc" folder in your local installation.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 21, 2006 11:11 am 
Expert
Expert

Joined: Thu Sep 22, 2005 10:29 am
Posts: 285
Location: Almassera/Valencia/Spain/EU/Earth/Solar system/Milky Way/Local Group/Virgo Supercluster
I think it is:
Code:
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="use_sql_comments">true</property>


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