The Isolation level is REPEATABLE_READ.
The logic is as under:
Transaction begins Read data from Table A If (Table A has Any Data) End Transaction and exit If Table A has No Data, Proceed further Delete a record in Table B Transaction ends
Now, my question is about the following scenario:
- The current execution reaches at point #4.
- I someone inserts data (Note, the current execution is at point # 4) in the Table A that would have returned some result in #2.
- Now, The current execution will execute #5. It will delete a record that should not be deleted.
Is there any implicit locking in transaction or do I need to lock Table A Explicitly so no one can insert any data in Table A before I commit changes?