SQL Exception

Status
Nicht offen für weitere Antworten.

BigBoss

Aktives Mitglied
hi,

Code:
java.sql.SQLException: Communication link failure: java.net.SocketException, underlying cause: socket closed

ich hab gerade das problem das ein programm diese Exception wirft ohne einen wirklichen grund zu haben.
Die Datenbank ist da und wurde auch in der Zeit als die Exception auftrat nicht neugestartet.
Diese Exception tritt auch nur vereinzelt auf und auch nicht immer. Nach einem Neustart des Programms läuft dieses ohne probleme.
Hat irgend jemand eine idee was diese exception auslösen kann und wie man das verhindert?
Gruß & thx BB
 

L-ectron-X

Gesperrter Benutzer
Eventuell nimmt der DB-Server keine Anfragen mehr an, weil bspw. ein Timeout konfiguriert ist.
 

BigBoss

Aktives Mitglied
kannst du das etwas genauer erklären?
Ich kann nicht nachvollziehen wieso der das tun sollte.
Gruß BB
 
M

maki

Gast
Naja, eine spordische "Socket closed Exception" wäre eher ein Anzeichen dafür das ein Timeout, wie von L-ectron-X vorgeschlagen, die Ursache ist.

Oder der Server hat ein Limit an offenen Connections, oder das Netzwerkkabel ist lose... ;)
 
G

Guest

Gast
danke erstmal für die Antworten
aber ich benutze keinen pool und die hardware ist auch komplett in ordnung.
die möglichkeit mit dem connectionlimit währe möglich aber der fehler ist bis jetzt immer früh zwischen 7 & 8 uhr aufgetreten wo der mysqlserver noch nicht mal annähernd belastet wird
kann ich irgendwie was genaueres aus der fehlermeldung rausbekommen?
Gruß & thx BB
 
T

tuxedo

Gast
Das hört sich doch stark nach einem TimeOut an...

Wenn die Verbindung zur DB über einen längeren Zeitraum nicht aktiv genutzt wird, dann kommt i.d.R. ein Fehler in der von dir beschriebenen Art.

Entweder du suchst mal nach einen "keep alive" in bezug auf die Connection, oder du sorgst dafür dass regelmäßig eine Anfrage an die DB geht.

- Alex
 

BigBoss

Aktives Mitglied
hmm das komische ist ja das es kein timeout sein kann da kurz vor dieser exception ein sqlquery erfolgreich ausgeführt wird.
Gruß BB
 

The_S

Top Contributor
Du bekommst auch nen Timeout wenn eine Abfrage zu lang dauert. Angenommen der Timeout ist auf 15 Minuten eingestellt. Jetzt hast du aber ne hammermäßige Abfrage die 16 Minuten dauert. Dann bekommste nach 15 nen Timeout.
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
KOKASS Exception bei Datenbankconnect Datenbankprogrammierung 9
Kirby.exe SQL-Exception: Column not found Datenbankprogrammierung 6
S MySQL hibernate exception: illegal state exception : entityManagerFactory is closed Datenbankprogrammierung 5
G MySQL Java Problem: Nullpointer Exception obwohl Daten vorhanden sind? Datenbankprogrammierung 2
G PostgreSQL Nach Monaten auf einmal ClassNotFound-Exception Datenbankprogrammierung 3
K JPA Projekt Exception Datenbankprogrammierung 7
C jpa, exception Predeployment of PersistenceUnit failed Datenbankprogrammierung 1
M CommunicationLinkError - NullPointer Exception Datenbankprogrammierung 11
T MongoDB: Morphia REST 505 Exception Tomcat Datenbankprogrammierung 2
M SQL-Exception trotz funktionierendem SELECT Datenbankprogrammierung 4
N JDBC: rollback() bei Exception geht nicht!? Datenbankprogrammierung 1
M SQL Exception Datenbankprogrammierung 6
L Probleme mit DriverManager.getConnection(..) - Endlosschleife, Java Absturz, Keine Exception Datenbankprogrammierung 4
D Hibernate SaveOrUpdate Exception Datenbankprogrammierung 2
E MySQL Hibernate mit JaxWS führt zu LazyInitialization Exception Datenbankprogrammierung 8
E PostgreSQL Exception too ...many clients already bei DB-Abfrage Datenbankprogrammierung 14
T java sql exception getDate() Datenbankprogrammierung 2
O Viele Verbindungen-Exception bei insert Daten zur MySQL-Datenbank Datenbankprogrammierung 2
E Sql Exception Datenbankprogrammierung 14
M NestedTransaction- Exception in Hibernate Datenbankprogrammierung 15
F Derby/JavaDB SQL-Exception...Aber wieso!? :/ Datenbankprogrammierung 2
T Exception ResultSet Datenbankprogrammierung 7
Paristick MSSQL - JDBC Exception beim Registrieren Datenbankprogrammierung 5
S Null Pointer exception statement Datenbankprogrammierung 8
G JDBC Exception Datenbankprogrammierung 3
S ResultSet einer Datenbankabfrage - Nullpointer Exception Datenbankprogrammierung 13
F Derby/JavaDB Exception - Cannot accept Null Value (help) Datenbankprogrammierung 10
G Stored Procedure Exception Handling Datenbankprogrammierung 3
C SQL Exception auf Unique überprüfen Datenbankprogrammierung 5
B Hibernate+JPA Exception in persistence.xml Datenbankprogrammierung 5
L SQL Exception Problem Datenbankprogrammierung 7
M hilfe zur einer Exception Datenbankprogrammierung 2
J Nullpointer Exception bei Zugriff auf Datenbank Datenbankprogrammierung 13
A MySQL Anbindung - Exception Handling Datenbankprogrammierung 2
R SQL Exception: Cursor position not valid Datenbankprogrammierung 7
O Oracle 11g wirft bei 90 % der installation eine Exception ? Datenbankprogrammierung 5
R Warum kommt eine Exception bei instanceof ? Datenbankprogrammierung 4
E Datenbankverbindung Java MySQL Exception Datenbankprogrammierung 10
N Class not found Exception Datenbankprogrammierung 2
A Exception in thread "AWT-EventQueue-0" java.lang.N Datenbankprogrammierung 4
M SQL Exception bei LIMIT Datenbankprogrammierung 11
megachucky Problem mit: SQL Exception Before start of result set Datenbankprogrammierung 2
W updateRow() schmeißt eine Exception, weil schreibgeschützt Datenbankprogrammierung 6
M Sql Anfrage wirft Exception Datenbankprogrammierung 5
6 Communications link failure due to underlying exception Datenbankprogrammierung 10
R SQL Exception "Weiterleiten der Egebnissmenge" Datenbankprogrammierung 15
märliprinz Exception in thread "main" java.lang.OutOfMemoryEr Datenbankprogrammierung 9
S Java SQL-Exception bei Zugriff auf MSAccess Datenbankprogrammierung 2
K Exception bei Verbindungsaufbau Oracle Datenbank Datenbankprogrammierung 13
L "desc tablename" liefert SQL Exception mit execute Datenbankprogrammierung 6
M SQL Exception Datenbankprogrammierung 3
M Problem mit dem ActionListener und SQL Exception Datenbankprogrammierung 6
D Exception bei ResultSet.moveToInsertRow Datenbankprogrammierung 6
EagleEye problem mit exception Datenbankprogrammierung 2
L UPDATE löst Exception aus Datenbankprogrammierung 6
V Exception beim Speichern von eingegebenen Daten in Tabelle Datenbankprogrammierung 2
G ich bekomm immer die exception grrrr Datenbankprogrammierung 3
D Unklare SQL Exception Datenbankprogrammierung 3

Ähnliche Java Themen

Neue Themen


Oben