1. 程式人生 > >MySQLNonTransientConnectionException: No operations allowed after statement closed hibernate

MySQLNonTransientConnectionException: No operations allowed after statement closed hibernate

exceptio 如果 false 題解 ans stat transient opera closed

第一種是在DB連接字符串後面加一個參數。

這樣的話,如果當前鏈接因為超時斷掉了,那麽驅動程序會自動重新連接數據庫。

jdbc:mysql://localhost:3306/makhtutat?autoReconnect=true

現在的問題就是出在autoReconnect=true,改成false後,問題解決。

MySQLNonTransientConnectionException: No operations allowed after statement closed hibernate