title: Java. Cannot open connection
body: <p>I'm using </p>
  
  <blockquote>
    <p>oracle.ucp.jdbc.PoolDataSource</p>
  </blockquote>
  
  <p>for getting connections. Each connection wrapped to custom class (historic solution). Generally connection is getting by entityManager. My system require hight performance processing. There is ThreadPool using for it. Thread pool can provide <strong>15</strong> threads at the same time, like connection pool. 
  Every thing works fine, but sometimes i get exception (in this moment were used only 4 connections):</p>
  
  <pre><code>2012-09-26 17:51:45.835 | ERROR | ThreadExecutor-7 | org.hibernate.ejb.AbstractEntityManagerImpl | Exception in thread "ThreadExecutor-7"
  javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Cannot open connection
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1235)
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1168)
      at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:1245)
      at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:63)
      ...
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
  Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
      at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
      at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
      at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:142)
      at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:85)
      at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1463)
      at org.hibernate.ejb.TransactionImpl.begin(TransactionImpl.java:60)
      ...
      at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
  </code></pre>
  
  <p><strong>If i synchronize specified <em>getConnection</em> performance of the system going down 8-12 times.</strong></p>
  
  <p>Is any ideas for fix?</p>