I can't believe myself but suddenly it's all working. The attached DBI::Pool (while still requering mysql) is working with both: threads and non-threads perl! tested with 5.8.0 and blead perls.

It could be that I've missed something, but the package doesn't segfault anymore.

Changes since my last post for those who tried it before:

I copy imp_dbh and store the copy (no more problems with threads exiting earlier)

I tell DBI not to destroy the drivers private data (can't call DBIc_ACTIVE_off(imp_dbh) macro, but I've used the flag setting directly. The InactiveDestroy works as well, but I didn't want to introduce any changes to the user's normal use. I wanted the pool to be transparent to users).

I swear I did try it yesterday and it didn't work. (may be I was trying each of these changes separately, and that's why it didn't work)

Finally I had to add a boot section to call DBISTATE_INIT to keep non-threads perl happy.

And on the perl side, I had to write DBI::threads which allows you to run the code written for threads without threads-enabled perl. it's just a quick hack, but it does the job. This is something that we need in our perl threads toolkit, hopefully someone will complete it and release it on CPAN.

So give it a run and tell me if you have any problems. (to try just run 'perl Makefile.PL && make test')

If it's cool, we need to finish discussing the required DBI API changes and put it in! But in reality if you use only one dsn (and mysql), you can already start using DBI::Pool without changing anything at all in your code (since it disregards dsns for now when storing objects)

oh, and I have to try it with mod_perl 2.0.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Attachment: DBI-Pool-0.01.tar.gz
Description: application/gzip



Reply via email to