> The MySQL driver does not support CFTRANSACTION. Except for 
> the inability to rollback, does anyone see a problem with 
> using a CFLOCK tag instead?
> 
> <cflock name="fooUpdate" timeout="5">
>       <cfquery name="" datasource="#request.mainDSN#">
>               INSERT INTO foo
>               VALUES( bla bla )
>       </cfquery>
>       <cfquery name="new" datasource="#request.mainDSN#">
>               SELECT max(fooID) AS ID
>               FROM foo
>       </cfquery>
> </cflock>

I'm no MySQL expert, but it seems to me that this won't work in all cases.
In this case, specifically, where you're working with a surrogate key that's
created by the database, I think it should work, but it won't work for more
complex things; in those cases, you may have to organize the naming scheme
for your locks by table, rather than by an action within the table.

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
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

Reply via email to