Web DBI - State-less-ness
No fixed client-server pair
- Each request can be handled by a different process.
- So can't simply stop fetching when one page is complete and continue fetching from the same $sth when the next page is requested.
- And transactions can't span requests. Even if they could you'd have problems with database locks being held etc.
Need access to 'accumulated state' somehow:
- via the client (e.g., hidden form fields)
- via the server:
- in the database (records in a session_state table keyed by a ‘session id’)
- in the web server file system (DBM files etc) if shared across servers
- Need to purge old state info if stored on server, so timestamp it
- See Apache::Session module
- DBI::ProxyServer + connect_cached with session id may suit, one day