var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: select/update/insert question
I have the following problem -
if exists (select on pk from Table A)
update (some non pk column in Table A)
where (pk on Table A)
insert (values into Table A)
This block is not in any explicit transaction.
When executed in multi-threaded environment, clearly there is a race here and two threads can fall into the insert block, leading to duplicate key insert error.
Can someone provide some guidance on the best way to solve this.
Thanks in advance.
Have you try the cursors ?
Thanks. Can you please elaborate ? How is this done with cursors to ensure two threads do not try and insert at the same time.
For that, you lock the table like this.
lock table TABA in exclusive mode
lock the table before starting your tran
Is this really the most effective way ? Is it not going to compromise concurrency immensely ?