|
-
Mar 13th, 2009, 08:33 AM
#7
Re: How to handle this situation
If you don't want trivial answers, don't give trivial questions & examples.... in your example. you are getting a recordset, looping through it to update the count one by one.... that's an expensive operation for a trivial task. So I gave a simplified solution to it. There's no guarantee that transactions will never clash... all you can do is minimize the likelihood of it happening... which is exactly what my solution offers.... a quick in and out, with the least amount of fuss.
You last sample doesn't simulate two process at all.... it's a sigle process that does one thing with a sleep in it... what does that prove? Nothing.
Ultimately if you are trying to avoid errors, write queries that fit and don't do trivial non-usefull operations... secondly... error handling. If you're worried about errors, handle them.... when they happen, handle them gracefully so that the application doesn't tank.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|