• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Read and write to table at same time

Explorer ,
Sep 05, 2023 Sep 05, 2023

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?

 

 

 

TOPICS
Getting started

Views

97

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2023 Sep 10, 2023

Copy link to clipboard

Copied

First of all, what is the brand and version number of your database software?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2023 Sep 10, 2023

Copy link to clipboard

Copied

LATEST

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.
***/
}



 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation