How to Prevent Concurrency Problem
I have built a custom AIC (IPipelineComponent), All it does is it parses incoming string and dumps values into database and write a log file..
Initially I had Concurrency problems while inserting into database however in database part I was able to control using
"SET TRANSACTION ISOLATION LEVEL SERIALIZABLE"
For logfile I had done something like this
If Fso.FileExists(Fname) = False Then Fso.CreateTextFile Fname
After this I was able to prevent concurrency, BUT I KNOW THIS IS NOT A CORRECT WAY TO PREVENT CONCURRENCY...
AND ALSO I WANT TO ADD COUNTER TO THE COMPONENT WHICH OPENS A TEXT FILE UPDATES THE VALUE BY 1 EVERY TIME IT PROCESS A DOCUMENT... HOW I PREVENT OTHER THREADS FROM UPDATING WHILE ONE THREAD IS MODIFYING IT....