title: How to find number of database round trips by an application
body: <p>I am a java programmer and I want to know how many database calls/trips are done by my application. We use Oracle as our relational database.<br>
  With oracle, I got to know about a way to alter session statistics and generate the trace files. Below are the queries to be fired:</p>
  
  <pre><code>ALTER SESSION SET TIMED_STATISTICS = TRUE;
  
   ALTER SESSION SET SQL_TRACE = TRUE;
  </code></pre>
  
  <p>After the trace files are generated, they could be read using the TKProf utility. But this approach cannot be used because:</p>
  
  <ol>
  <li>my application uses hibernate and spring frameworks and hence the application does not have an handle to the session. </li>
  <li>Even if we get the trace files, I need to know whether the set of queries are fired in one go (in a batch) or separately. I am not sure if TkProf output could help to understand this.</li>
  </ol>
  
  <p>Does anyone have any better suggestions?</p>