title: No Buffer Space available(maximum connection reached?) Form Postgres EDB Driver
body: <p>We are facing an exception while connecting to database through our java application. The stack trace is as follows</p>
  
  <pre><code>com.edb.util.PSQLException: The connection attempt failed.
   at com.edb.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:189)
   at com.edb.core.ConnectionFactory.openConnection(ConnectionFactory.java:64)
   at com.edb.jdbc2.AbstractJdbc2Connection.&lt;init&gt;(AbstractJdbc2Connection.java:161)
   at com.edb.jdbc3.AbstractJdbc3Connection.&lt;init&gt;(AbstractJdbc3Connection.java:30)
   at com.edb.jdbc3.Jdbc3Connection.&lt;init&gt;(Jdbc3Connection.java:24)
   at com.edb.Driver.makeConnection(Driver.java:391)
   at com.edb.Driver.connect(Driver.java:266)
   at java.sql.DriverManager.getConnection(Unknown Source)
   at java.sql.DriverManager.getConnection(Unknown Source)
   ... 12 more
  Caused by: java.net.SocketException: No buffer space available (maximum connections reached?): connect
   at java.net.PlainSocketImpl.socketConnect(Native Method)
   at java.net.PlainSocketImpl.doConnect(Unknown Source)
   at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
   at java.net.PlainSocketImpl.connect(Unknown Source)
   at java.net.SocksSocketImpl.connect(Unknown Source)
   at java.net.Socket.connect(Unknown Source)
   at java.net.Socket.connect(Unknown Source)
   at java.net.Socket.&lt;init&gt;(Unknown Source)
   at java.net.Socket.&lt;init&gt;(Unknown Source)
   at com.edb.core.PGStream.&lt;init&gt;(PGStream.java:70)
   at com.edb.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:115)
   ... 20 more
  </code></pre>
  
  <p>When the error occured we were not able to connect to internet and DB and had to reboot the system. But the error occured again after 3 days at same code i.e while connecting to DB. We checked TCP connections using netstat. But there were not many TCP connections i.e it has not reached the max limit.</p>
  
  <p>Our application has multiple long running Java processes that pools the DB connections (not more than 60) and keeps it alive for firing the next query (as it has to poll the DB every 2 seconds). Some of the queries in our application are joining large tables (10 million records) to get the related data. </p>
  
  <p>We are using following System and applications  </p>
  
  <ul>
  <li>Windows 2003 server SP2 </li>
  <li>Java 1.6</li>
  <li>Postgres Plus Advanced server 8.4   Database</li>
  <li><code>edb-jdbc14.jar</code> driver for connection DB from Java</li>
  </ul>
  
  <p>We have used the default configuration of Postgres DB except increasing the connection to 120 from 100. </p>
  
  <p>Has anybody encountred the same error with postgres edb driver?</p>
  
  <p>Can anybody help us finding the solution?</p>