Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Risk in using sequence number?
You don't give enough information to determine whether or not your
developer is correct or not.
This developer is most certainly correct if:
1 you have multiple users / processes generating events. In this case
even going down to 100ths of seconds still leaves a chance for a race
condition to occur.
2 you are not running OPS. There may ba a more meaningfull key to put
here but on single instance Oracle, there much fewer "what if" scenerios
with sequences.
3 have a rate of transactions that is high enough that it could outpace
dbms_utility.get_time. My bet is a well cached sequence will beat the
get_time procedure in terms of performance.
Your developer is wrong if:
1 you use OPS. This is a real can of worms any way you look at it. The
sequence is no longer reliable at a point in time reference so you can't
use it. I imagine sysdate could pose a problem as well due to A) race
conditions and B) two nodes not being synched on time
2 your events happen serially at a rate of less then 1 per second.
One thing to consider might be to look at Advanced Queues. I'm pretty sure they guarentee that records will come out in a FIFO order.
Good Luck
P.S. Everyone please feel free to shoot holes in the points I made.
-- Posted via Mailgate.ORG Server - http://www.Mailgate.ORGReceived on Thu Feb 21 2002 - 17:29:13 CST