I have a table with fields: name|...|start_date|end_date
My code now is:
select .... 'check for period intersection
insert .... 'if check succesfull insert new row
This code in one transaction. When two users try to insert new record in the same time with same fields(and periods intersects) two records inserted. But I want to avoid that inserting. First user must insert, other user must get conflict. How can I do it ?
P.S. I use IBM DB2