title: How to log the start and the completion of DB transactions in Hibernate
body: <pre><code>sql_show = true
  </code></pre>
  
  <p>this property in hibernate prints the sql that is run, but i want to see the <code>begin transaction</code> and <code>complete transaction</code> statements as well so that i can track the transaction duration and see the query run in which transaction.</p>
  
  <p>googling reveals that</p>
  
  <pre><code>log4j.logger.org.hibernate.SQL = DEBUG, defaultAppender
  log4j.logger.org.hibernate.type = DEBUG, defaultAppender
  log4j.logger.org.hibernate.transaction=DEBUG, defaultAppender
  </code></pre>
  
  <p>should show you the transaction level data as well.
  But it doesnt.</p>
  
  <p>Investigating more i looked into hibernate code and found a class name</p>
  
  <pre><code>org.hibernate.ejb.TransactionImpl
  </code></pre>
  
  <p>this class has the begin and complete method but this method does not log any thing.</p>
  
  <p><strong><em>Any advice how to see the transaction level info in hibernate</em></strong> ?<br>
  I am using hibernate 2.2</p>