This project is archived and is in readonly mode.
SqlBypass session store doesn't use ActiveRecord::Base connection
-
Michael Koziarski
- State changed from new to resolved
-
Grant Hutchins
- Tag cleared.
- Assigned user set to Michael Koziarski
Excuse me if I'm wrong, but was it a mistake to mark this ticket resolved?
I am still seeing the issue that the original reporter describes, and it has been impeding my ability to use SqlBypass in my application.
-
Luca Guidi
This is the commit: http://github.com/rails/rails/commit/42cdc7571d115c5eb4ece440001d22...
Which version of Rails are you using? -
Grant Hutchins
I'm using Rails 2.3.5 (and was on 2.3.4 when I wrote the previous comment).
I think I've figured out what's going on. The patch you mentioned fixes the issue for the find_by_session_id method, but I was running into problems with the other methods, which still use @@connection.
I'll look into writing a patch.
-
Chris Pruett
I patched the code to use
connectioninstead of@@connection, which fixed the issue for the first call to session. However, on subsequent requests, I receive this error:Mysql::Error: query: not connected: SELECT * FROM sessions WHERE session_id='1338b0600b1eddf9871f1fb878ac9bff'
Patching the
connectionmethod to this seems to fix the issue, but I'm not sure why or if it's the right solutiondef connection @@connection = ActiveRecord::Base.connection end
