Grails gorm not reconnecting to mysql on Communications link failure

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails gorm not reconnecting to mysql on Communications link failure

danyyacoub
Hello,

I have a process on Grails 2 that handles requests from the DB...every 2 to 3 weeks I get the error

SQL Error: 0, SQLState: 08S01
 spi
.SqlExceptionHelper  - Communications link failure


The last packet successfully received from the server was 1,681 milliseconds ago.  The last packet sent successfully to the server was 1,681 milliseconds ago.


The worst part is that the application doesn't reconnect and my process keeps hanging until i restart tomcat myself

- I've checked the configuration on my.cnf
- I've added all the info in my datasource configuration for reconnect, timeouts and validation queries
- The connection to the DB is never idle since I query the DB every second to retrieve records
- I'm catching the throwable when this error occurs but I'm still unable to do anything about it
Does anyone have any hint of how to solve this issue ?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/380a366e-39a8-43a5-8d60-56ba80cea90b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grails gorm not reconnecting to mysql on Communications link failure

Ronald Kayondo
I would recommend switching to  a more reliable data-source like HIKARI. It makes extra effort to make sure that the database connection is valid before it hands over the connection to the client code.

Recently hosted Grails system on a managed database server where connections held for more than minute would get killed. Hikari came to the rescue even with the default settings.

Ronald

On Tue, Aug 14, 2018 at 4:48 PM Dany Yacoub <[hidden email]> wrote:
Hello,

I have a process on Grails 2 that handles requests from the DB...every 2 to 3 weeks I get the error

SQL Error: 0, SQLState: 08S01
 spi
.SqlExceptionHelper  - Communications link failure


The last packet successfully received from the server was 1,681 milliseconds ago.  The last packet sent successfully to the server was 1,681 milliseconds ago.


The worst part is that the application doesn't reconnect and my process keeps hanging until i restart tomcat myself

- I've checked the configuration on my.cnf
- I've added all the info in my datasource configuration for reconnect, timeouts and validation queries
- The connection to the DB is never idle since I query the DB every second to retrieve records
- I'm catching the throwable when this error occurs but I'm still unable to do anything about it
Does anyone have any hint of how to solve this issue ?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/380a366e-39a8-43a5-8d60-56ba80cea90b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Ronald. K

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAEstujR-xx7-TigVcNRhf_xY7%2BanSgdDR31%2Bpu7yhssnhG%2BYVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grails gorm not reconnecting to mysql on Communications link failure

demon101
In reply to this post by danyyacoub
I think, you can solve it by configuration of database pool like c3p0 or tomcat jdbc pool  https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

вторник, 14 августа 2018 г., 15:48:32 UTC+2 пользователь Dany Yacoub написал:
Hello,

I have a process on Grails 2 that handles requests from the DB...every 2 to 3 weeks I get the error

SQL Error: 0, SQLState: 08S01
 spi
.SqlExceptionHelper  - Communications link failure


The last packet successfully received from the server was 1,681 milliseconds ago.  The last packet sent successfully to the server was 1,681 milliseconds ago.


The worst part is that the application doesn't reconnect and my process keeps hanging until i restart tomcat myself

- I've checked the configuration on my.cnf
- I've added all the info in my datasource configuration for reconnect, timeouts and validation queries
- The connection to the DB is never idle since I query the DB every second to retrieve records
- I'm catching the throwable when this error occurs but I'm still unable to do anything about it
Does anyone have any hint of how to solve this issue ?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/38ae8dca-54c7-4f9c-a505-588c8f2732c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Grails gorm not reconnecting to mysql on Communications link failure

danyyacoub
In reply to this post by Ronald Kayondo
Hello, 

Sorry I took so long to respond, but I was checking if the HIKARI datasource works, and unfortunately yesterday the issue happened again. and with the HIKARI datasource it couldn’t reconnect alone. I had to restart tomcat.

Any change I should do ? or do you suggest something else ?

Thanks,
Dany

On Aug 14, 2018, at 6:19 PM, Ronald Kayondo <[hidden email]> wrote:

I would recommend switching to  a more reliable data-source like HIKARI. It makes extra effort to make sure that the database connection is valid before it hands over the connection to the client code.

Recently hosted Grails system on a managed database server where connections held for more than minute would get killed. Hikari came to the rescue even with the default settings.

Ronald

On Tue, Aug 14, 2018 at 4:48 PM Dany Yacoub <[hidden email]> wrote:
Hello,

I have a process on Grails 2 that handles requests from the DB...every 2 to 3 weeks I get the error

SQL Error: 0, SQLState: 08S01
 spi
.SqlExceptionHelper  - Communications link failure


The last packet successfully received from the server was 1,681 milliseconds ago.  The last packet sent successfully to the server was 1,681 milliseconds ago.


The worst part is that the application doesn't reconnect and my process keeps hanging until i restart tomcat myself

- I've checked the configuration on my.cnf
- I've added all the info in my datasource configuration for reconnect, timeouts and validation queries
- The connection to the DB is never idle since I query the DB every second to retrieve records
- I'm catching the throwable when this error occurs but I'm still unable to do anything about it
Does anyone have any hint of how to solve this issue ?

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/380a366e-39a8-43a5-8d60-56ba80cea90b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Ronald. K

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/CAEstujR-xx7-TigVcNRhf_xY7%2BanSgdDR31%2Bpu7yhssnhG%2BYVA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/7F487120-6F17-48AD-92AC-7E802805DA96%40gmail.com.
For more options, visit https://groups.google.com/d/optout.