True, transactions are not supported in MySQL.  A CFLOCK would not create a
database transaction, and would not provide some of the benefits of
transactions such as rollback, but in this case it would have a similar
effect of making sure that no-one else was generating a new ID at the same
time.  You would have to use an application wide, named, exclusive lock for
it.  Your code looks like it might do if you set it up as an exclusive
lock...

-Cameron

--------------------
Cameron Childress
ElliptIQ Inc.
p.770.460.7277.232
f.770.460.0963

> -----Original Message-----
> From: Bud [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 13, 2000 12:41 PM
> To: CF-Talk
> Subject: cflock vs. cftransaction
>
>
> Hi all. When advancing the ID in a database by pulling up the max(id)
> as maxid then <cfset newid = query.maxid + 1> and inserting the new
> record, I've always used cftransaction around the queries. This gives
> an error in MySQL that transactions aren't supported. Will using
> cflock do the same thing?
>
> <cflock name="cust#attributes.dsn#" timeout = "10">
> queries
> here
> </cflock>
>
> Thanks.
> --
>
> Bud Schneehagen - Tropical Web Creations
>
> _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
> ColdFusion Solutions / eCommerce Development
> [EMAIL PROTECTED]
> http://www.twcreations.com/
> 954.721.3452
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to