You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Christian Cryder <c....@gmail.com> on 2006/01/18 22:10:09 UTC

DBCP - Socket Exceptions

Hi guys,

I have searched through recent archives and haven't seen anything about
this, so if I'm just not looking in the right place, please feel free to
point me in the right direction.

I am trying to wrap NetDirect's JSQLConnect driver in DBCP (because
NetDirect seems to have a problem in their own connection pooler).

So I am setting up the data source like this:

    <object name="$ds" class="org.apache.commons.dbcp.BasicDataSource">
        <method name="setDriverClassName">com.jnetdirect.jsql.JSQLDriver
</method>
        <method name="setUrl">jdbc:
JSQLConnect://localhost/database=KilimanjaroTest/user=sa</method>
    </object>

This is how we use DBCP for Postgres drivers, and it seems to work fine
there (in all cases). It seems to work ok, here, at least for individual
junit test cases. The problem is, about half way through our test cases, we
start getting failures like this:

DBComms.transmit exception:[java.net.SocketException: Connection reset by
> peer: socket write error] context:[(2) [Thread[main,5,main], IO:21e9e,
> Dbc:4997]]]
> com.jnetdirect.jsql.v: DBComms.transmit exception:[
> java.net.SocketException: Connection reset by peer: socket write error]
> context:[(2) [Thread[main,5,main], IO:21e9e, Dbc:4997]]]
> at com.jnetdirect.jsql.v.a(Unknown Source)
> at com.jnetdirect.jsql.h.a(Unknown Source)
> at com.jnetdirect.jsql.av.a(Unknown Source)
> at com.jnetdirect.jsql.af.new(Unknown Source)
> at com.jnetdirect.jsql.af.do(Unknown Source)
> at com.jnetdirect.jsql.ap.executeQuery(Unknown Source)
> at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(
> DelegatingPreparedStatement.java:205)
> at
> com.atmr.kilimanjaro.core.sql.jdbc.PreparedStatementWrapper.executeQuery(
> PreparedStatementWrapper.java:43)
> at com.atmr.kilimanjaro.testbed.SQLValidator.validateSQLQuery(
> SQLValidator.java:203)
> at com.atmr.kilimanjaro.testbed.DefaultTestCase.validateSQLQuery(
> DefaultTestCase.java:221)
> at
> com.atmr.kilimanjaro.core.sql.samples.sql.TestBinary99SQL.testBinary99SQL(
> TestBinary99SQL.java:82)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:25)
>

My guess is that the underlying NetDirect driver might be closing something
when it shouldn't, or something like that. But the test cases work fine when
run individually (even those test cases that use many connections).

I am hoping that there might be some configuration option that would make
things work better. I have tried playing w/ the settings I've found here
http://jakarta.apache.org/commons/dbcp/configuration.html (like initialSize,
maxActive, maxIdle, etc), but none of them seem to make any difference.

Does anyone have any suggestions?

tia,
Christian