How to reconnect lost connections with EclipseLink?

前端 未结 1 1863
刺人心
刺人心 2021-01-18 09:14

I have the problem if the mySQL Server kills the session after 500 sec \"sleeping-time\", that the next request isn\'t successful. The same problem occurs after maybe 700 se

1条回答
  •  囚心锁ツ
    2021-01-18 10:00

    How have you configured your connection pool? If it a server datasource, the properties such as connection testing should be set in the server. See http://docs.oracle.com/cd/E21764_01/web.1111/e13737/ds_tuning.htm#i1199711 for example settings.

    If it is an EclipseLink pool, it should automatically attempt to retry queries when it detects a connection failure by default. The properties controlling the behavior are only accessible through api in the DatabasePlaform class for your specific database, and can be set through a customizer as described here: How To modify Eclipselink JPA 2.0 connection retry behavior

    0 讨论(0)
提交回复
热议问题