Artistic Opinion: Would reconnecting the damaged handle
and keep it usable with an appropriate error then loosing
the transaction (and letting the caller deal with it
as an exception) seem reasonable?

Yes. That would possibly suffice is all code gets its statement handles
via prepare_cached(). But then if all code used prepare_cached() and
connect_cached() then you wouldn't need to go down this road at all :)

Trick is to have the caller avoid having to use
connect_cached for themselves each time they
access the database handle. Ideally they should
be able to:

   {
       my $dbh = DBIx::Priaprism( @blah );

       sub foo
       {
           do
           {
               eval
               {
                   $dbh->foo( ... );
               };
           }
           while( $@ =~ /Reconnected/ );
       }
   }

and have the connection up forever.


--
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
[EMAIL PROTECTED]                                     1 888 359 3508

Reply via email to