users@glassfish.java.net

Re: AutoCommit based validation detected invalid connection

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Mon, 05 Apr 2010 21:11:25 +0530

Based on the exception :
"Caused by: java.io.EOFException: Can not read response from server.
Expected to read 4 bytes, read 0 bytes before connection was
unexpectedly lost.
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2332)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2774)
        ... 76 more
"

it is possible that the "wait_timeout" server variable set in MySQL
server for connections is lesser.
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
Since you are seeing the exception every 10 minutes, it is possible that
the "wait_timeout" is <= 10 minutes. Can you try increasing the value
(eg: 30 minutes) and see whether that solves the issue ?

Thanks,
-Jagadish


On Mon, 2010-04-05 at 08:18 -0700, Sessizlik wrote:
> Hi,
>
> I am using mysql-connector-5.1.5 and my server is GFv3.
>
> My connection pool configuration is like this.
>
> <jdbc-resource pool-name="TestDSPool" jndi-name="TestDS" />
> <jdbc-connection-pool connection-validation-method="auto-commit"
> datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"
> res-type="javax.sql.XADataSource" name="TestDSPool"
> is-connection-validation-required="true" allow-non-component-callers="true">
> <property name="password" value="yyyyyyyyyyyy" />
> <property name="username" value="xxxxxxxxxxx" />
> <property name="URL" value="jdbc:mysql://x.x.x.x/myapplication" />
> </jdbc-connection-pool>
>
>
>
>
> My log file is here
>
> http://old.nabble.com/file/p28141042/log.txt log.txt
>
>
> Thanks
>
>
> Jagadish Prasath Ramu wrote:
> >
> > Can you provide your connection pool configuration, MySQL driver and
> > server versions ?
> >
> > If possible, use "auto-commit" based validation itself with finest log
> > level (as indicated in the INFO message in server.log) for
> > "resource-adapter" using the command :
> > asadmin set-log-level javax.enterprise.resource.resourceadapter=FINEST
> >
> > and post the complete stack trace from server.log ?
> >
> > Thanks,
> > -Jagadish
> >
> >
> >
> > On Mon, 2010-04-05 at 05:58 -0700, Sessizlik wrote:
> >> Hi,
> >>
> >> I tried to change my validation method. But when I try to change it, It
> >> does
> >> not show me which table I have to choose to validate.
> >>
> >> Did I miss something?
> >>
> >> Thanks
> >>
> >>
> >>
> >> Shalini Muthukrishnan wrote:
> >> >
> >> > Hi,
> >> >
> >> > Looks like some of the connections in your pool may have become stale
> >> or
> >> > invalid. The connection validation is turned on in your jdbc connection
> >> > pool and this will ensure that a connection taken from the pool is in a
> >> > healthy state.
> >> >
> >> > It may so happen that the autocommit values are cached by your jdbc
> >> > driver. Please change the validation method to "table" to see a more
> >> > realistic evalutation.
> >> >
> >> > HTH,
> >> > Shalini.
> >> >
> >> >
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: users-help_at_glassfish.dev.java.net
> >
> >
> >
>