Using Druid to report errors abandon connection, open stackTrace

< H2 > the cause of the problem < / H2 >

recently wrote a scheduled task using quartz . This scheduled task is mainly to add something like points to members, and to keep a record of points increase, which is executed at 4 o"clock every morning, but sometimes many members" points are not increased. Check the log and find that Druid throws out abandon connection, open stackTrace , and check the error code line. The exception was thrown when the credit increase record was saved, and it took 30 minutes to throw, that is, execution starts at 4 o"clock, and then the exception is thrown at 04:30, resulting in no increase in the user"s points.

< H2 > Table structure < / H2 >
   

at present, I have checked the code many times, but I have not found anything wrong with the code, nor do my colleagues. What is known is why an exception is thrown after 30 minutes, because removeAbandonedTimeout is set for 30 minutes. If you actively acquire the connection and do not release it for 30 minutes, the druid will be released automatically, that is, the code will stop for 30 minutes.

May.14,2022

will the processing logic of scheduled tasks take a long time?

if the time set by removeAbandonedTimeout is exceeded, Druid will recycle this connection remove

  

check the database connection count and check to see if there are other calls that did not release the connection

Menu