Copy link to clipboard
Copied
Hi,
Using coldfusion 10. Have one table insertion from Table A to Table B in a loop
With a flag=0 in TABLE B.
A scheduler is running at 5 minute interval reading data in a batch of 2000 from Table B and processing it.
After process, update Flag =1.
When there was around 20,000 data in Table A, it inserted only around 16,000 records and stopped.
Is it because of simultaneously read and write operations?
What is the ideal way to avoid partial insertion?
Copy link to clipboard
Copied
First of all, what is the brand and version number of your database software?
Copy link to clipboard
Copied
In any case, it would perhaps be better to make the two processes mutually exclusive. For example, by using a named lock.
Some pseudocode to illustrate:
lock name="processABC123Lock" {
/***
Code that inserts from table A to table B.
***/
}
// Elsewhere
lock name="processABC123Lock" {
/***
Code that processes rows in table B.
***/
}