Dear All,
I have data coming into my db at quite a high frequency. Once I recieve the data I have many different db operation (select, update)checking and one final insert. Before inserting I will check it exist before or not? The problem at times the similar data comes apart just few seconds. So I am worried the checking will miss because another insert have not been completed yet? Any suggestion?
newbie14
0
Posting Pro
Recommended Answers
Jump to PostThat is what transactions are for. Bracket your check and insert procedure in a transaction which you can roll back in case of duplicate values.
Jump to Post1) Start the transaction.
2) Do your processing and send a flag if a notification must be sent.
3a) Commit the transaction OR
3b) Unset the notification flag and roll back the transaction.
4) Check if the notification flag is set and sent the email accordingly.
All 8 Replies
smantscheff
265
Veteran Poster
newbie14
0
Posting Pro
smantscheff
265
Veteran Poster
newbie14
0
Posting Pro
smantscheff
265
Veteran Poster
newbie14
0
Posting Pro
smantscheff
265
Veteran Poster
newbie14
0
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.