You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Lucas Fragomeni <lu...@lucasfragomeni.com> on 2004/09/20 06:14:13 UTC

java.sql.SQLException: Communication link failure: java.io.IOException

Help! 

Here is my problem: i have a web application running perfectly well at home, but when I put it on my host provider it just keeps throwing, from time to time, a java.sql.SQLException, originated from a org.apache.torque.TorqueException, caused by a java.io.IOException:
 
Everything starts on the 'getConnection()', and happens only from time to time...
Would it have something to do with the way my host provide treats security and connection pools?
 
Bellow is the stack trace I get:
 
java.sql.SQLException: Communication link failure: java.io.IOException
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1675)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1083)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1114)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:1873)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:1819)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:1800)
        at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:604)
        at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(ConnectionImpl.java:370)
        at org.apache.commons.dbcp.datasources.SharedPoolDataSource.setupDefaults(SharedPoolDataSource.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)
        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:387)
        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:355)
        at infuse.syo.torque.BasePaginaPeer.doSelect(BasePaginaPeer.java:324)
        ...
rethrown as org.apache.torque.TorqueException: Communication link failure: java.io.IOException
        at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:755)
        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)
        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:387)
        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:355)
        at infuse.syo.torque.BasePaginaPeer.doSelect(BasePaginaPeer.java:324)
        ...
Caused by: java.sql.SQLException: Communication link failure: java.io.IOException
        ...
        ... 50 more


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Select from multiple tables

Posted by Arinaya Khalsa <ar...@realidea.ca>.
Hi All,

I have a search results screen where data is pulled from two different
tables, the second one however is linked via two other tables, so I need
to select across four tables in all. What is the most elegant way to do
this using Torque?

Lets call them Table1, Table2, Table3 and Table4.

Table2 has FKs pointing to Table1 and Table3; Table3 has a FK pointing
to Table4. I need to display data from Table1 and one column from Table4
in the jsp. It seems like it would be easiest to do multiple selects and
return two different result Lists to the jsp, and loop thru them in
parallel. Is there a better way?

I am new to Torque and would really appreciate some help!

Thanks,

Arinaya



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: java.sql.SQLException: Communication link failure: java.io.IOException

Posted by Andras Balogh <an...@reea.net>.
Hello Lucas,

I would try to play a little bit with the connection settings of mysql, see:
http://dev.mysql.com/doc/connector/j/en/index.html#id2424263
(Connection Properties*)
*I think what it interests you is the 'autoReconnect' property.

Best regards,
Andras.

Lucas Fragomeni wrote:

>Help! 
>
>Here is my problem: i have a web application running perfectly well at home, but when I put it on my host provider it just keeps throwing, from time to time, a java.sql.SQLException, originated from a org.apache.torque.TorqueException, caused by a java.io.IOException:
> 
>Everything starts on the 'getConnection()', and happens only from time to time...
>Would it have something to do with the way my host provide treats security and connection pools?
> 
>Bellow is the stack trace I get:
> 
>java.sql.SQLException: Communication link failure: java.io.IOException
>        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1675)
>        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1083)
>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1142)
>        at com.mysql.jdbc.MysqlIO.sqlQuery(MysqlIO.java:1114)
>        at com.mysql.jdbc.Connection.execSQL(Connection.java:1873)
>        at com.mysql.jdbc.Connection.execSQL(Connection.java:1819)
>        at com.mysql.jdbc.Connection.execSQL(Connection.java:1800)
>        at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:604)
>        at org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(ConnectionImpl.java:370)
>        at org.apache.commons.dbcp.datasources.SharedPoolDataSource.setupDefaults(SharedPoolDataSource.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)
>        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:387)
>        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:355)
>        at infuse.syo.torque.BasePaginaPeer.doSelect(BasePaginaPeer.java:324)
>        ...
>rethrown as org.apache.torque.TorqueException: Communication link failure: java.io.IOException
>        at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:755)
>        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)
>        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:387)
>        at infuse.syo.torque.BasePaginaPeer.doSelectVillageRecords(BasePaginaPeer.java:355)
>        at infuse.syo.torque.BasePaginaPeer.doSelect(BasePaginaPeer.java:324)
>        ...
>Caused by: java.sql.SQLException: Communication link failure: java.io.IOException
>        ...
>        ... 50 more
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: java.sql.SQLException: Communication link failure: java.io.IOException

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
Lucas Fragomeni <lu...@lucasfragomeni.com> writes:

>Help! 

:-) 

>Here is my problem: i have a web application running perfectly well at home, but when I put it on my host provider it just keeps throwing, from time to time, a java.sql.SQLException, originated from a org.apache.torque.TorqueException, caused by a java.io.IOException:
>�
>Everything starts on the 'getConnection()', and happens only from time to time...
>Would it have something to do with the way my host provide treats security and connection pools?
>�
>Bellow is the stack trace I get:
>�
>java.sql.SQLException: Communication link failure: java.io.IOException

This is an I/O error, which means that the problem happens deep inside
your JDBC driver. Probably it lost its connection to the
database. This could be everything from a rebooted switch between your
database server and your application server to a MySQL maintenance
shutdown. This has IMHO nothing to do with Torque.

	Regards
		Henning

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org