Can there be a race condition when two Actions are trying to insert rows on the same table?

Hi,

I have 3 Actions on a Table1. On Form close event a Group Action (Action1) fires two separate actions (Action2 and Action3). Action2 and Action3 are both inserting rows on the same underlying table (Table2). Sometimes I saw both rows getting added but sometimes I see only one. I tried running Action2 and Action3 separately and both of them are adding rows. Then I kept the Google sheet open when the transactions are fired and saw something weird. Sometimes both rows will come in fine but at times I see one row being written but very quickly being overwritten by the second call. For further troubleshooting, I then turned on "Need Confirmation?" on all 3 actions and found the following. If I confirm the messages quickly both records are inserted. But if I delay my confirmations for 5-6 seconds, then I get an error saying "Action Failed : Transaction is already closed" (see attached).

Group Action FailureGroup Action Failure

I am a bit puzzled and any help or pointers in resolving the issue will be greatly appreciated.

Thanks.

Solved Solved
0 3 163
2 ACCEPTED SOLUTIONS

try adding 1 column and set it to uniqueid in initial value

View solution in original post

Issue solved. The underlying Table had Timestamp as the Key column. Thats why when multiple rows were coming in on the same second, they were overwriting each other. Adding a new ID column with UniqueID solved the problem.

View solution in original post

3 REPLIES 3

try adding 1 column and set it to uniqueid in initial value

Yah, just figured that out. Thanks for your reply.

Issue solved. The underlying Table had Timestamp as the Key column. Thats why when multiple rows were coming in on the same second, they were overwriting each other. Adding a new ID column with UniqueID solved the problem.

Top Labels in this Space