[Koha-bugs] [Bug 18855] Fines cronjob can cause duplicate fines if run during active circulation

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 1 20:51:11 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18855

Michael Hafen <michael.hafen at washk12.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |In Discussion

--- Comment #14 from Michael Hafen <michael.hafen at washk12.org> ---
(In reply to Andreas Jonsson from comment #13)
> Using a table lock seems like a crude solution.
> 
> Why not use a transaction?

I agree that the table lock is pretty ugly.  Honestly, I haven't tested that it
solves the problem either.  Think of it, it probably creates a problem where
the accountlines table is locked during circulation.  (I just found out that
foreign key tables also get locked, which compounds this problem.)

But a transaction would not prevent multiple threads from changing the same
row, which is what I was trying to catch there.

I'd be fine with going back to Martin's patches.  (But a test would still have
to be written. ;) )  Besides, I'm not even using the table locking patch in
production here.

I've moved on from this, so I'll have to dig in a bit to remember what all is
going on, to figure out how much of a problem the 'renewed is still overdue so
new fine' case is.  This keys on the issue_id, but maybe that can be changed to
key on the accountlines_id instead; that would be a better solution to this
problem I think.

I'll dig in a bit and see if I can get this to key on the accountlines_id
instead.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list