title: Oracle getConnection slow
body: <p>In a Java project, I am using an ojdbc6 jar</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.oracle&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc6&lt;/artifactId&gt;
          &lt;version&gt;11.2.0.1.0&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependenc&gt;
  </code></pre>
  
  <p>The first time for a day I run, dataSource.getConnection() is fast. Second time is usually okay. The next few times take around 45 seconds. After that, it takes multiple minutes. Once I have the FIRST connection of a given application run, any new connections I get are very very fast. This delay is only getting the FIRST connection for a given run.</p>
  
  <p>What is making getting my first connection so slow?</p>
  
  <p>I am watching netstat and don't see any connection hanging after a successful run. Have tried several different connection pools (<strong>DBCP, C3PO</strong>) with no luck. Debugging through source code, the delay is 100% on the line of <strong>org.springframework.jdbc.datasource.DataSourceUtils</strong>: </p>
  
  <pre><code>Connection con = dataSource.getConnection();
  </code></pre>
  
  <p>Any ideas?</p>
  
  <p><strong>Edited For More Details</strong></p>
  
  <p>1) I am using a connection pool (DBCP or C3PO) which saves connections for future use. When I talk about getting a new connection, I mean while the first connection is in use.. I need to go to the DB and get a NEW connection. Of course I can return and get my same connection from the connection pool over and over again. But getting a second at the same time is also fast.</p>
  
  <p>2) I do not know how many connections my DB lets me be logged in with. Any idea where this property is in oracle?</p>