Moving database calls out of Session library into sessions model #632

wants to merge 1 commit into

5 participants


For those of us with 'special' database needs (in my case, connecting to DB2 and using non-standard field names in the session table), having all the database calls embedded in the session class is a pain in the keister. I've moved them out into a sessions model which makes fiddling around with session handling a simple matter of overriding 5 function calls.


hrm, I see your point, however, would good support for DB2 be better? How are you working with DB2 now, is that something you'd like to see about contributing back?


Support for DB2 would be great, though my situation is probably pretty unusual -- I doubt too many people are running CI on an IBM iSeries. I actually ended up making native database calls (it looks a lot like PDO, but even more of a pain) and not using the ActiveRecord tools at all. I might try to wrap my code in something that's more general-purpose, but right now it's not fit for public consumption.

Moving the database code out helps everyone who has funky database issues. I wrote (and re-wrote) my data access libraries repeatedly trying to get something that would work well on the iSeries but once I had the database calls moved out of the session class, I didn't have to muck around in there again. I just overrode the model.


I`ve got similar thing I run some apps on Tomcat/Quercus env. I need to have an access to java backend because we have SOA env. running lots of hubs and adapters with heavy data load.
In my case I have php-java mapper/driver extended by models (where java backend deals with DB using hibernate) Updating the session table is done by Auth model (it loads user_session_model), I gave up with updating user_session table using Session lib.

@timw4mail timw4mail commented on the diff Nov 4, 2011
// No result? Kill it!
- if ($query->num_rows() == 0)
+ if (!$result)
timw4mail Nov 4, 2011

Picky, but the style guide says to surround ! with spaces.


The Session class has been drastically changed since this PR was submitted and to be honest - I don't think this is the right approach at all.
Also, DB2 is supported via PDO in develop.

@narfbg narfbg closed this Oct 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment