Welcome Guest, Not a member yet? Register   Sign In
Sessions in database other than default?
#6

It won't help ... You're shooting in the dark here and that rarely yields positive results.

IMO, those GET_LOCK() queries aren't stuck ... they're waiting for RELEASE_LOCK() calls from other processes. To improve on that - call session_write_close() as soon as you no longer need to write new session data.

If you still want to try, there's a little trick ...

The documentation says you have to use the default connection because that's the one connection that's almost guaranteed to exist, but technically it just looks for get_instance()->db (and loads the 'default' connection if that doesn't exist) and creates a copy of it. So you can do something like this:

Code:
$this->default_db = $this->db;
unset($this->db);
$this->db = $this->load->database('session', TRUE);
$this->load->library('session');
$this->db = $this->default_db;
unset($this->default_db);

I wouldn't get my hopes up though ... I don't see how moving sessions to another database would help - GET_LOCK() will still block new requests until the lock is released.
Reply


Messages In This Thread
RE: Sessions in database other than default? - by Narf - 03-31-2016, 10:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB