activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jamie McCrindle" <>
Subject Re: sqlserver/ jtds "Address already in use: connect" exceptions under load
Date Thu, 13 Jul 2006 11:02:44 GMT
Some more info:

It's definitely an issue with the jtds driver creating too many
connections which end up in TIME_WAIT and then running out of client
connections (verified using tcpview). I was using the dbcp
BasicDataSource as in:

  <bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource"
    <property name="driverClassName"
    <property name="url"
    <property name="username" value="username"/>
    <property name="password" value="password"/>
    <property name="poolPreparedStatements" value="true"/>

which resulted in the "Address already in use: connect" issue. By
moving to the following configuration:

  <bean id="mssql-ds" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
    <property name="serverName" value="localhost"/>
    <property name="portNumber" value="1443"/>
    <property name="databaseName" value="xxx"/>
    <property name="user" value="xxx"/>
    <property name="password" value="xxx"/>

the exception goes away but the too many connections problem is still
there. the jtdsdatasource just pauses until the TIME_WAIT connections
free up and then carries on from where it left off.

It's all a bit odd because this message from the jtds guys suggests
that it shouldn't be using quite so many connections:

i could mess with my operating system's tcp settings to reduce the
TcpTimedWaitDelay but it feels more like treating the symptoms rather
than addressing the problem.

I'll see if I can get more information from the jtds guys but if
anyone else has solved the problem for activemq and mssqlserver or has
any ideas, let me know.


On 7/12/06, Jamie McCrindle <> wrote:
> Hi all,
> First off, thanks for fixing the autocommit bug in 4.0.1. I've
> upgraded now and I seem to be getting a new problem using sqlserver
> 2005 and jtds under load, specifically:
> Caused by: Address already in use: connect
>         at Method)
>         at
>         at
>         at
>         at
>         at
>         at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
>         at java.lang.reflect.Method.invoke(
>         at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSoc
>         at net.sourceforge.jtds.jdbc.SharedSocket.<init>(
>         at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(
> :297)
> The only reference on the internets that I could find related to this issue is:
> any idea's?
> versions of things:
> SQLServer 2005
> jTDS 1.2
> cheers,
> j.

View raw message