in reply to Using a single DBI handle in a script and a module

Aside from Web Server-specific interfaces for persistent database connections like Apache::DBI, I was just looking at Ima::DBI, which might just solve some of the problems you have. According to the docs, amongst it's features are:

* Sharing of database and sql information amongst inherited classes
Any SQL statements and connections created by a class are available to its children via normal method inheritance.

* Guarantees one connection per program.
One program, one database connection (per database user). One program, one prepared statement handle (per statement, per database user). That's what Ima::DBI enforces. Extremely handy in persistant environments (servers, daemons, mod_perl, FastCGI, etc...)

Check it out, see if that's a sloution for you. And if you do use it, let us know how it goes, as it'll be a while before I can pay with it... :(

----Asim, known to some as Woodrow.

  • Comment on Re: Using a single DBI handle in a script and a module