perleager:
I was reading the CGI::Session manual (like a good little developer does :-)) and I noticed that you are using the DEPRECATED method 'close()' (the horror!!)
Currently you call 'load()' (passing in the ID) and then call 'is_expired()', and then, if it's expired, call delete(). My thought is that CGI::Session, when it calls the 'load()' it may very well call the 'is_expired()' off the hop. Are you 100% sure that after load()ing an 'expired session' that CGI::Session isn't doing data store cleanup? (ie. already removing it)
IMO - I think you should write your own 'is_expired()' sub that inspects a Session.ID using DBI, which returns true/false. Write another sub that takes a Session.ID and deletes it's using DBI (e.g execute SP or DELETE statement.) Once you've got those pieces done, your CRON job loops front to back on the Session table, passing each ID to the 'is_expired()' sub, calling the delete when true. Conceptually what you have already but avoid the load()ing of the already expired session.
Maybe I'll just have to write some code to show you what I mean.... if you're even still reading this thread. ;-)
Kurt
In reply to Re: CGI::Session disconnect invalidates 1 active statement handle
by whereiskurt
in thread CGI::Session disconnect invalidates 1 active statement handle
by perleager
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |