TastyWheat
Registered User.
- Local time
- Today, 03:56
- Joined
- Dec 14, 2005
- Messages
- 125
Is there a special way I can execute two transactions (a read and a write) without interruption from other transactions/users?
I'm implementing my own autonumber system so that the numbers rollover after 4 digits. Before you sound the alarm, I'm not using this as my primary key, it's just an ID that's used around the office. At first I wasn't worried about race conditions (e.g. two users trying to get an autonumber at the same time) but now I am. I want to make sure my code performs a SELECT then an UPDATE back-to-back without any other transactions (on that record) occuring in between.
I'm implementing my own autonumber system so that the numbers rollover after 4 digits. Before you sound the alarm, I'm not using this as my primary key, it's just an ID that's used around the office. At first I wasn't worried about race conditions (e.g. two users trying to get an autonumber at the same time) but now I am. I want to make sure my code performs a SELECT then an UPDATE back-to-back without any other transactions (on that record) occuring in between.