[DB-SIG] Database connections don't stay alive
Olli Rajala
olli.rajala at gmail.com
Sat Jun 4 18:39:50 CEST 2005
Chris Cogdon wrote:
> The 'problem' here is that the database object goes out of scope when
> the function exits. When 'out of scope' objects get cleaned up is
> fairly implementation dependant, which is likely why it was working
> with MySQL.
Oh, thanks. Now it works as it should. Yeah, I thought that the
solution isn't probably very hard, but when you don't get it, you just
don't get it. :) When doing this transfer (MySQL->PostgreSQL) in my
code, I invent some ways to reduce the number of code lines and was
able to cut the size of my sql-module about 40-50%. So, some thing
lead to another, and so on. There is stille quite much cleaning and
refactoring to do, but luckily it just is for my own (and my wife's
too) personal use, so... ;))
Maybe some day I know enough to make good code. These days I know
enough to be dangerous. ;)
Thanks guys!
--
Olli Rajala <><
Tampere, Finland
http://www.students.tut.fi/~rajala37/
"In theory, Theory and Practice should be
the same. But in practice, they aren't."
- Murphy's Proverbs
More information about the DB-SIG
mailing list