Are you using in your schema LONG type columns?
----- Original Message -----
From: "Michael Kucera" <[EMAIL PROTECTED]>
To: "Apache Torque Users List" <[EMAIL PROTECTED]>
Sent: Thursday, November 27, 2003 11:53 AM
Subject: MySQL: Unexpected end of input stream
Hi,
I'm hoping that someone might have some insight into a problem I am
having. I am using Torque with MySQL and everything has been working
great until now. I have a demo version of my app running on a server.
After the app has been idle for a long time (several hours) it will
generate an error on a database access (select). If the database access
is attempted a second time it works.
Here is a piece of the stack trace:
java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1405)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1020)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1109)
at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1070)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2027)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1996)
at com.mysql.jdbc.Connection.execSQL(Connection.java:1977)
at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:654)
at
org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(Connect
ionImpl.java:370)
at
org.apache.commons.dbcp.datasources.SharedPoolDataSource.setupDefaults(S
haredPoolDataSource.java:258)
at
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(
InstanceKeyDataSource.java:704)
at
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(
InstanceKeyDataSource.java:665)
at
org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:743)
at org.apache.torque.Torque.getConnection(Torque.java:306)
at
org.apache.torque.util.Transaction.beginOptional(Transaction.java:118)
at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1365)
Here is a sample of my Torque.properties
torque.database.default=db
torque.database.db.adapter=mysql
torque.dsfactory.db.factory=org.apache.torque.dsfactory.SharedPoolDataSo
urceFactory
torque.dsfactory.db.pool.defaultMaxActive=10
torque.dsfactory.db.pool.testOnBorrow=true
torque.dsfactory.db.pool.validationQuery=SELECT 1
torque.dsfactory.db.connection.driver = com.mysql.jdbc.Driver
torque.dsfactory.db.connection.url = jdbc:mysql://localhost/blah
torque.dsfactory.db.connection.user = blah
torque.dsfactory.db.connection.password =
I think MySQL is closing idle connections and Torque dosen't like it.
Has anyone else had this problem? Should I try using a different pool?
If so which pool? Is there something wrong with my config?
I could always write code that catches the first exception and then
makes a second attempt but that seems hacky and dosen't get at the heart
of the problem.
Any help is greatly appreciated. Thanks!!!
Michael Kucera
Programmer/Analyst
BBM Canada
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]