Perda de conexao

3 respostas
andredeividi

Ola

pessoal estou pegando um problema no meu sistema que esta me deixando louco.

quando o usuario abre um tela e não faz nada tipo vai ao banheiro e depois volta e começa trabalhar na tela tipo vai inserir algum registro nobanco estoura um exception
java.sql.SQLException: No operations allowed after connection closed. Connection was closed due to the following exception: ** BEGIN NESTED EXCEPTION ** java.sql.SQLException MESSAGE: Communication link failure: java.io.EOFException, underlying cause: null ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(Unknown Source) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.checkErrorPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Statement.executeQuery(Unknown Source) at com.softin.aginesNetwork.gui.components.LabelDataTop.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ** END NESTED EXCEPTION ** STACKTRACE: java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null ** BEGIN NESTED EXCEPTION ** java.io.EOFException STACKTRACE: java.io.EOFException at com.mysql.jdbc.MysqlIO.readFully(Unknown Source) at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.checkErrorPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Statement.executeQuery(Unknown Source) at com.softin.aginesNetwork.gui.components.LabelDataTop.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ** END NESTED EXCEPTION ** at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.checkErrorPacket(Unknown Source) at com.mysql.jdbc.MysqlIO.sendCommand(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(Unknown Source) at com.mysql.jdbc.MysqlIO.sqlQuery(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Connection.execSQL(Unknown Source) at com.mysql.jdbc.Statement.executeQuery(Unknown Source) at com.softin.aginesNetwork.gui.components.LabelDataTop.run(Unknown Source) at java.lang.Thread.run(Unknown Source) ** END NESTED EXCEPTION **
Alguem te ideia do que pode ser ?

abraço

3 Respostas

benflodin

Cara se seu codigo estiver todo limpo e não existir nenhum passo ou thread que está fechando essa conexão, provavelmente isso esta sendo ocasionado por intermitencia na rede.

andredeividi

A minha classe de conexão era um classe normal,
então achei que podia ser alguma coisa matadando a instancia da classe sei
la então fiz ela Singleton mesmo assim da erro.
ate achei que podia ser o timeout do mysql mas não porque esta setado 8 horas. isso ocorre se a tela ficar inativa uns 10 minutos.

desde ja agradeço

ramilani12

Veja se esses links não te ajudam
http://bugs.mysql.com/bug.php?id=11259
http://bugs.mysql.com/bug.php?id=620

tenha certeza que esteja fechando tudo ResultSet , Statement , PreparedStatement , CallableStatement e Connection

Criado 18 de maio de 2007
Ultima resposta 20 de mai. de 2007
Respostas 3
Participantes 3