Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

jtboofle
Copy link

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.

@gaker
Copy link
Contributor

gaker commented Oct 28, 2011

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?

@jtboofle
Copy link
Author

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.

@qrool
Copy link

qrool commented Oct 28, 2011

@jtboofle
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.


// No result? Kill it!
if ($query->num_rows() == 0)
if (!$result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@narfbg
Copy link
Contributor

narfbg commented Oct 23, 2012

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants