ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Multi threaded app gets java.netBindConnection: Address already in use: connect
Date Fri, 29 Dec 2006 07:47:06 GMT
Either you are not releasing resources properly or the amount of
concurrent threads exceeds the value of
${geneDatasetDb.maximumActiveConnections}.

 

Niels

 

________________________________

From: Peter Andrews [mailto:peter.andrews@Dartmouth.EDU] 
Sent: donderdag 28 december 2006 20:16
To: user-java@ibatis.apache.org
Subject: Multi threaded app gets java.netBindConnection: Address already
in use: connect

 

Hello,

I am using iBATIS to retrieve data on multiple threads simultaneously. I
have experienced this problem with the svn 2.3.0 .xxx version and also
the 2.2.0 GA release.

I get the error if I use DBCP or SIMPLE for my datasource. The value of
'commitRequired' has no effect on whether the exception occurs. Once the
first exception occurs, there are dozens.

  <transactionManager type="JDBC" commitRequired="true">
    <dataSource type="SIMPLE">
      <property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
      <property name="JDBC.ConnectionURL"
value="jdbc:mysql://${geneDatasetDb.hostAndPort
<mysql://$%7bgeneDatasetDb.hostAndPort> }/geneDataset"/>
      <property name="JDBC.Username" value="${geneDatasetDb.username}"/>
      <property name="JDBC.Password" value="${geneDatasetDb.password}"/>
      <property name="Pool.MaximumActiveConnections"
value="${geneDatasetDb.maximumActiveConnections}"/>
    </dataSource>
  </transactionManager>

Here is the stack trace:
com.mysql.jdbc.CommunicationsException: Communications link failure due
to underlying exception: 

** BEGIN NESTED EXCEPTION ** 

java.net.SocketException
MESSAGE: java.net.BindException: Address already in use: connect

STACKTRACE:

java.net.SocketException: java.net.BindException: Address already in
use: connect
        at
com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:
156)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:276)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:2666)
        at com.mysql.jdbc.Connection.<init>(Connection.java:1531)
        at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:26
6)
        at java.sql.DriverManager.getConnection(DriverManager.java:525)
        at java.sql.DriverManager.getConnection(DriverManager.java:171)
        at
com.ibatis.common.jdbc.SimpleDataSource.popConnection(SimpleDataSource.j
ava:580)
        at
com.ibatis.common.jdbc.SimpleDataSource.getConnection(SimpleDataSource.j
ava:222)
        at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.init(JdbcTrans
action.java:48)
        at
com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.getConnection(
JdbcTransaction.java:89)
        at
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQuery
ForObject(GeneralStatement.java:104)
        at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlM
apExecutorDelegate.java:565)
        at
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlM
apExecutorDelegate.java:540)
        at
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSes
sionImpl.java:106)
        at
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(SqlMapClie
ntImpl.java:84)
        at
org.epistasis.db.SqlMapClientWrapper.queryForObject(SqlMapClientWrapper.
java:60)
        at
org.epistasis.db.geneAnnotation.GeneAnnotationDbAccess.getGeneById(GeneA
nnotationDbAccess.java:113)
        at org.epistasis.db.geneDataset.Dataset$4.run(Dataset.java:631)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
        at java.util.concurrent.FutureTask.run(FutureTask.java:123)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecuto
r.java:650)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.ja
va:675)
        at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **

Anyone have ideas/suggestions?

Thanks,

Peter





-- 
--------------
Peter Andrews
Software Engineer
Dartmouth Medical School
Computational Genetics
Rubin 707
(603) 653-3598

Mime
View raw message