abstract:
ex.
Code:
<cflock timeout="60" throwontimeout="yes" type="exclusive" scope="application">
<!--- insert new record --->
<!--- select max(id)... --->
</cflock>
If I have a registration form where a new record is inserted into one table and then want to select that new record's id using a select max(id) query, can I surround my code with cflock to ensure that the max(id) selected is actually the id of the record just inserted? Will the cflock prevent other potential users from inserting a new record until the previous record is inserted and it's id is selected?
ex.
Code:- <cflock timeout="60" throwontimeout="yes" type="exclusive" scope="application">
- <!--- insert new record --->
- <!--- select max(id)... --->
- </cflock>
Copy Code |