0
我正在爲以下問題尋找解決方案,如果您有任何想法,請在嘗試從java(jboss服務器)運行單個查詢時分享 ,我會得到以下異常(不頻繁)。MySQL中的通信異常
Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException:
The last packet successfully received from the server was43200 seconds ago. The last packet sent successfully to the server was 43200 seconds ago,
which is longer than the server configured value of 'wait_timeout'.
You should consider either expiring and/or testing connection validity before use in your application,
increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true'
to avoid this problem.*
如果連接空閒,它由MySQL關閉。在這種情況下,Java將給予不能寫:斷管「或類似的例外 ,但在這種情況下,連接不是空閒的,它正在工作,所以MySQL不會關閉它,但是Java正在等待查詢結果並且無法獲得它12小時,使其顯示「讀取超時」異常
實際上正在使用NanoPoolDataSource已經...如果我去虛擬查詢。是不會導致任何其他問題,如交通 – Karthick
不是它是單一的查詢,不返回任何數據,你像每小時發射它 –
我沒有得到你什麼是虛擬查詢這裏,我應該創建空表並開始在循環中獲取表格數據。你能舉一些例子嗎? – Karthick