I would make sure autocommit is set to off
you would'nt want statement 1 to prepare/execute and
statement 2 fails..
statement1 executes but statement2 prepares but never executes leaving 
transaction intedeterminant
(but then again ...you can always rollback)

Martin 
______________________________________________ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Thu, 13 Nov 2008 11:02:06 +1100
> From: [EMAIL PROTECTED]
> Subject: Re: DBD::oracle question about auto reconnecting
> To: [EMAIL PROTECTED]; [email protected]
> 
> I echo Tim's comments.  We looked into implementing auto reconnect for
> our applications (e.g. in the case of the DB going down) and unless you
> have a *very* simple scenario it was just too much work to save and
> restore state.
> 
> For example, you could lose the connection between a ->prepare and an
> ->execute.  On reconnecting you would need to know to go back and
> prepare the statement again.
> 
> What if you were in the middle of a transaction?  On reconnect you would
> need to know when the last commit happened and redo any work since then.
> 
> Very messy if not impossible to handle in a generic way.
> 
> Steve
> 
> On Wed, 2008-11-12 at 15:41 +0000, Tim Bunce wrote:
> > On Tue, Nov 11, 2008 at 11:27:59AM -0500, Patrick Galbraith wrote:
> > > John,
> > >
> > > Hi! DBD::mysql uses mysql_auto_reconnect to connect back to MySQL if the 
> > > connection drops
> > >
> > > $dbh= DBI->connect('DBI:mysql:test:mysql_auto_reconnect=1', $foo, 
> > > $fee)...;
> > >
> > > or of course
> > >
> > > $dbh->{mysql_auto_reconnect};
> > >
> > > In the perl side of the driver:
> > >
> > > if ($this && ($ENV{MOD_PERL} || $ENV{GATEWAY_INTERFACE})) {
> > >        $this->{mysql_auto_reconnect} = 1;
> > >    }
> > >
> > > I had this off once with a release I did, and a lot of people were very 
> > > unhappy ;)
> > 
> > I hope they all appreciate the risks they're taking if they use locks
> > or any other server state that would be silently lost by an auto reconnect.
> > 
> > > So, whatever might give the functionality to reconnect automatically
> > > I suppose it'd be the same as doing
> > >
> > > unless ($dbh->ping) {
> > >    $dbh= .... connect ...
> > > }
> > 
> > The DBI spells that DBI->connect_cached(...)
> > 
> > Tim.
> 
> 
> 
> ******************************************************************
> This email is intended solely for the use of the addressee and may
> contain information that is confidential, proprietary, or both.
> If you receive this email in error please immediately notify the
> sender and delete the email.
> ******************************************************************

_________________________________________________________________
Get 5 GB of storage with Windows Live Hotmail.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_5gb_112008

Reply via email to