I would test this carefully because I'm not convinced that CFTRANSACTION can be used 
to control the actions of a SP.  I believe it is for CFQUERY only.  Can anyone confirm 
this?

Yes, you can return success/failure codes from the SP to CF, but at that point all the 
SP's queries have executed and committed (or rolledback, if the code to handle the 
transaction was in the SP code) and I don't see how CFTRANSACTION can alter that.

It's important because if someone assumes they can rollback what a SP does, but then 
can't...KA-BOOM!

Chris

> -----Original Message-----
> From: Robertson-Ravo, Neil (RX)
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 09, 2003 9:43 AM
> To: CF-Talk
> Subject: RE: cftransaction quick question
> 
> 
> -- No need for cftransaction on a single SQL query
> 
> >>   True, but to avoid ugly error I would suggest using 
> cftry/cfcatch to
> catch db errors
> 
> - cftansaction is good practice for a single stored procedure call in
> -- case the stored procedure is doing multiple SQL queries
> 
> >> cftransaction should ALWAYS be used for db calls / procedures which
> perform updates/detes or inserts.  its simple good practice and avoids
> errors.
> 
> 
> 
> 
> 
> 
> 
> -----Original Message-----
> From: David Collie (itndac) [mailto:[EMAIL PROTECTED]
> Sent: 09 July 2003 14:26
> To: CF-Talk
> Subject: RE: cftransaction quick question
> 
> 
> Oops, good point Neil...
> 
> I was initially thinking that it would <cfquery> rather than
> <cfstoredproc>
> 
> So.... a little bit like this?
> 
> - No need for cftransaction on a single SQL query
> - cftansaction is good practice for a single stored procedure call in
> case the stored procedure is doing multiple SQL queries
> 
> DC
> 
> > -----Original Message-----
> > From: Robertson-Ravo, Neil (RX) 
> > [mailto:[EMAIL PROTECTED] 
> > Sent: 09 July 2003 14:07
> > To: CF-Talk
> > Subject: RE: cftransaction quick question
> > 
> > 
> > No true (well at least for Stored Procedures)  as what if the 
> > SP does 10 other things before the actual failure?  i.e. if 
> > you are simply doing one update - then no need for a rollback 
> > / update etc BUT for an SP you do require at least a commit 
> > or rollback.
> > 
> > 
> > 
> > 
> > -----Original Message-----
> > From: Lofback, Chris [mailto:[EMAIL PROTECTED]
> > Sent: 09 July 2003 14:04
> > To: CF-Talk
> > Subject: RE: cftransaction quick question
> > 
> > 
> > > My thinking is that if the single query fails, there 
> > wouldn't be any 
> > > need for a rollback.... how does that sound?
> > 
> > Sounds good to me.  AFIK, a query either succeeds or 
> > fails--there's no such thing as partial success in a SQL 
> > statement.  So if the query fails, there's no change in the 
> > DB that would need to be rolled back.
> > 
> > Chris
> > 
> > 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. 
http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to