[CDBI] Class::DBI vs DBIx::Class

Tim Bunce Tim.Bunce at pobox.com
Wed Jan 18 23:43:51 GMT 2006


On Wed, Jan 18, 2006 at 07:37:59AM -0500, John Siracusa wrote:
> On 1/18/06 6:36 AM, Tim Bunce wrote:
> > On Tue, Jan 17, 2006 at 08:12:48PM -0500, John Siracusa wrote:
> >> On 1/17/06 7:56 PM, Tim Bunce wrote:
> >>> Class::DBI and DBIx::Class (and others) should probably be passing 3
> >>> for the $if_active parameter. Set it and forget it.
> >> 
> >> I explored that a while ago (Rose::DB::Object passes 3 as you suggest), but
> >> it still doesn't account for the situation where the db supports server-side
> >> prepared statements and the schema changes between calls.  I encountered
> >> this in my benchmark suite, which creates and drops indexes as part of its
> >> execution.  Any statement that was prepare_cache()d server-side when the
> >> indexes existed will fail if execute()d after the indexes are dropped.
> > 
> > That's a database-specific issue. What database were you using?
> 
> Postgres.
> 
> > It's also possible to $dbh->{CachedKids} = {} to clear out the cached
> > statement handles explicitly if desired. (Such as when you're using
> > SQLite and know the schema has changed.)
> 
> Actually, I'd like it if DBD::Pg would detect this particular kind of error
> and simply re-prepare.  If it still fails, then propagate the error.  But
> otherwise, it's very tedious to have to wrap every prepare_cached() -- not
> to mention error-prone, since detecting the specific "schema changed" error
> would likely involve regex matching error messages.

I agree. The current behaviour is clearly unhelpful.
(I'd guess that they'd accept a patch :-)

Tim.




More information about the ClassDBI mailing list