> One thing I would say about the use of MAX(ID) is that if you
> are going to use it, you need to lock access down to it using
> cflock to avoid the situation described above....
>  
> Place this around the entire section of code  from just
> before the select query until just after the insert query....
>  
> <cflock name="MAXIDCriticalSection" type="exclusive" timeout="30">
>  
> .....
>  
> </cflock>
>
>
> It is a performace hit but you will not have people
> attempting to insert duplicate IDs into your database,
> guaranteed!

Out of curiosity, why do you recommend using CFLOCK instead of
CFTRANSACTION? The CFLOCK tag only affects CF code, and any decent database
provides transactional support. Using the database's own transactional
support seems superior in several respects, to me.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to