0
On my hosting service, whenever the time_out
server arrives in 8 hours, gives this error:
com.mysql.jdbc.exceptions.jdbc4.Mysqlnontransientconnectionexception: No Operations allowed after Connection closed
After all queries I close the session, I take the connection of Hibernate do the query, populate the list and close the session with sessao.close()
.
I’ve done a lot of research and I see two different opinions on the subject:
One of them, put
autoconnect=true
, just as,jdbc:mysql:/127.0.0.1:3306/seubanco? autoReconnect=true
And in another, put the
time_out
28800 milliseconds server for a higher value.
I’m very confused about this. What you think is the best option?
what can be said is that he tried to make a query and the Connection was closed, without code there is no way to say much but what appears to be is a mismanagement of opening and closing connections
– Lucas Miranda