[Koha-bugs] [Bug 10454] Duplicate card numbers may be generated

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Sat Jun 22 06:31:06 CEST 2013


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10454

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |In Discussion

--- Comment #4 from M. Tompsett <mtompset at hotmail.com> ---
Others have suggested last_insert_id. Is last_insert_id a good option? The DBI
page has scary things like: "Given all the caveats above, it's clear that this
method must be used with care." And some of those are ugly caveats.

I was thinking of generating an ID made of 4 parts which should be unique
enough:
1) 16 character random string (A-Za-z0-9 character options).
2) process id padded to 6 digits
3) microsecond time padded to 20 digits
4) CGISESSID (or a 32 character random string if undefined).

This, however, during testing created an every changing cardnumber when I just
felt bored and clicked refresh on memberentry.pl

So, I added a check for just the session id part to see if it is in borrowers.
If not, then it would reuse it. Duplication should only happen on multi-tab
stupidity, as far as I can tell.

This got me thinking, do I need anything other that CGISESSID? Feedback
appreciated.

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


More information about the Koha-bugs mailing list