Thanks for the clarification on Access, I believe you're right since 
it's
not a truly relational product.  However, I always use CFTry and 
CFCatch
with Inserts and Update queries.  The majority of errors occur when
modifying the data.  So, even if I roll back the change, I want to 
catch the
error and redirect the user as well as send myself a note along with 
the
malformed query to troubleshoot the code.  CFTry and CFCatch were the 
tags I
hated the most when I first started using them since they made it 
harder to
debug.  But after I made up my own tags to handle the errors, they 
became my
best friends.  I will admit, however, that they clutter the code a bit.

Good Fortune,
Rick Walters
Webmaster, Davita Laboratory Services
Office: (800) 604-5227
Cell: (407) 491-9848

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 11:34 AM
To: CF-Talk
Subject: RE: Inserting and CFTransaction

> Access doesn't have any good way to prevent the multiple
> simultaneous insert problem. So, by using CFCatch, and
> CFTransaction you can catch the error of the second insert,
> rollback the changes and try again with a new value.
> CFTransaction seems to suggest that your set of queries
> will all run sequentially and then allow others to access
> the instance. But, in truth, I don't think the tables are
> locked.

In Access, whenever a record within a table is modified, the entire 
table is
exclusively locked. So, with CFTRANSACTION around both the query that
modifies a record, and the query that retrieves the autonumber value, 
no one
else will be able to access the table and insert another record until 
the
transaction has completed.

With other platforms, however, such as SQL Server, the entire table 
won't be
locked.

Note that there's no need to use CFTRY/CFCATCH in the above example, 
unless
your intent is to check a unique index or something along those lines.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to