[CDBI] dbi_commit not adding everything under mod_perl

Steve Sims steve at karmamusicgroup.com
Tue Apr 18 18:06:44 BST 2006


Hey gang,

I have a very strange problem which is confusing the hell out of me.

I recently migrated our web site's back-end database from MySQL to  
PostgreSQL.  This has mostly gone well, and I'm seeing vastly  
improved performance in areas that use complex queries - this is a  
great relief since I had a few queries where, if several of them were  
run concurrently, MySQL could fall over in a heap of quivering jelly.

One major problem I'm facing though is that records added to the  
database from scripts run under mod_perl seem to vanish.  Adjustments  
that get made to records *do* get committed successfully.  I'm not  
seeing any errors in the server log that would indicate any problems.

I had initially thought that this might be related to Apache::DBI,  
but when Apache::DBI is removed from the setup the problems remain.

I can see that these records are at least attempted to be written,  
since the sequence numbers for ids in the relevant tables go up.  It  
would seem that these records either get created and are then  
deleted, or are rolled back for some reason.  The roll-back theory  
doesn't make much sense though since alterations within the same  
transaction work.

Similar scripts on the web site that handle some other inserts, but  
do not get run using mod_perl, execute successfully.

My interim fix therefore is to not use mod_perl for the scripts that  
add things to the database.  This is a pain though - without mod_perl  
the AJAXy features of the site drag somewhat.

Googling about doesn't seem to give me much insight into this  
problem, unfortunately.  :-(

And before I forget, I'm using the latest Class::DBI, DBD::Pg,  
Apache::DBI, erm, and just about everything else.

So, does anybody around here have any insights or advice?

Cheers,

Steve




More information about the ClassDBI mailing list