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.
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.