title: transaction timeout not working on hibernate with oracle
body: <p>I am having problem setting the transaction timeout for hibernate on oracle. It does not work.Can anyone help? 
  The "SaveOrUpdate" will not return within the stated 10 seconds. It will hang for a very long time.
  I am using Oracle 10r2.</p>
  
  <p><B>Hibernate Configuration File</B></p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
      &lt;property name="connection.driver_class"&gt;oracle.jdbc.driver.OracleDriver&lt;/property&gt;
      &lt;property name="connection.url"&gt;jdbc:oracle:thin:@9.9.9.9:1521:orcl&lt;/property&gt;
      &lt;property name="connection.username"&gt;foouser&lt;/property&gt;
      &lt;property name="connection.password"&gt;foopass&lt;/property&gt;
      &lt;property name="hibernate.c3p0.min_size"&gt;5&lt;/property&gt;
      &lt;property name="hibernate.c3p0.max_size"&gt;20&lt;/property&gt;
      &lt;property name="dialect"&gt;org.hibernate.dialect.Oracle9Dialect&lt;/property&gt;
      &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
      &lt;!-- Disable the second-level cache  --&gt;
      &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
      &lt;!-- Echo all executed SQL to stdout --&gt;
      &lt;property name="show_sql"&gt;false&lt;/property&gt;
      &lt;!-- Mapping files --&gt;
      &lt;mapping resource="foo.hbm.xml"/&gt;
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p><B>Hibernate class</B></p>
  
  <pre><code>public class foo implements Serializable
  {
  ...
      public void save() throws Exception
      {
          Session     dbSession = null;
          Transaction tran      = null;
          try
          {
              dbSession = PersistenceMgr.getPersistenceMgr().getDbSession();
              tran      = dbSession.beginTransaction();
              tran.setTimeout(10); // 10 seconds
              dbSession.saveOrUpdate(this);
              tran.commit();
          }
          catch (HibernateException e)
          {
              if(tran!=null)
              {
                  try{tran.rollback();}
                  catch(HibernateException he){}
              }
              ...
          }
          finally
          {
              if( dbSession != null )
              {
                  try{dbSession.close();}
                  catch(HibernateException e){}
              }
          }
      }
  
  }
  </code></pre>