dbTalk Databases Forums  

are triggers atomic?

comp.databases.pick comp.databases.pick


Discuss are triggers atomic? in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank Winans
 
Posts: n/a

Default are triggers atomic? - 10-26-2006 , 09:38 AM






The recently-concluded thread on generating unique IDs
got me to thinking; If I write a trigger for a file, and am
invoking it from one login on port 13, do I know for a
fact that it will conclude before another login on say port
22 can invoke it? Not usually a consideration, but what
if it was mainaining some global stat like total file size or
census of the widgets described in the file...

Maybe I should have been using a readu lock in my
triggers, all these years...


Reply With Quote
  #2  
Old   
Dale
 
Posts: n/a

Default Re: are triggers atomic? - 10-26-2006 , 10:19 AM







Frank Winans wrote:
Quote:
The recently-concluded thread on generating unique IDs
got me to thinking; If I write a trigger for a file, and am
invoking it from one login on port 13, do I know for a
fact that it will conclude before another login on say port
22 can invoke it? Not usually a consideration, but what
if it was mainaining some global stat like total file size or
census of the widgets described in the file...

Maybe I should have been using a readu lock in my
triggers, all these years...
I don't think so. Since Pick, et al work run a multi-user operation by
time-slicing, you never really know when one process will lose its time
slice so the processor will move on to the next service.

In my testings for the unique id, many of the last processes I started
seemed to finish long before the processes that were started earlier.
This indicates to me that the time slicing, process through-put is not
linear, and depends on what other things might be going on in the
system.

I personally would always use a locking mechanism to ensure that items
get updated as they should. Maybe it is time to go back add a readu to
your code if accuracy is important.

Regards,

Dale



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.