Using CFLOCK for data Integrity
I plan to run the following two processes. In order to maintain data consistency I plan to use CFLOCK. I've never use CFLOCK in the past and not sure if this is going to work in maintaining data integrity. Please advise.
<cflock scope = "Session" timeout = "30" type = "Exclusive">
<cfexecute name="SomeName" arguments ="#PathToFile# #PathToLogfile#" errorFile="#PathToErrorFileLog#" outputFile="#PathToOutPutFileLog#"
timeout="300></cfexecute>
<cfquery name="UpdateUserID">
Update TempTable
SET UserID = '#session.userid#'
WHERE NVL(userid,' ') = ' '
</cfquery>
</cflock>
cfexecute is inserting data from a text file into a temp table.
There is one column in temp table that is not in the text file and that column is UserId column.
Aftr Oracle sqlldr inserting all data from text file to the temp table, I update userid column in temp table to the session.userid. This way I know who own the data after the process is done.
