-- 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

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

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

Reply via email to