order of geting value from sequence by trigger [message #652099] |
Wed, 01 June 2016 13:23 |
|
miodas007
Messages: 2 Registered: June 2016
|
Junior Member |
|
|
I have table where one column is auto incremented (sequence + before trigger).
When i have a couple of inserts to this table, close to each other (race case), and order is:
INSERT1
INSERT2
INSERT3
...
have i guarentee that values from sequence will be get with same order ?
In other words: after all inserts have i quarentee that last one have the growest value, and the first one have the lowest value?
In other words: In my case geting value from sequence and inserting it is transactional ?
|
|
|
|
|
Re: order of geting value from sequence by trigger [message #652107 is a reply to message #652101] |
Wed, 01 June 2016 15:56 |
|
miodas007
Messages: 2 Registered: June 2016
|
Junior Member |
|
|
Quote:If all inserts are made in one session, yes.
This inserts are made in diffrent sessions.
Quote:Otherwise you first have to define "order", order by insert statement execution time or order by transaction start time or transaction end (that is commit) time.
Assume two scenario:
1. by execution time
2. by transaction end time
What answer is for this cases?
[Updated on: Wed, 01 June 2016 15:57] Report message to a moderator
|
|
|
|
|
Re: order of geting value from sequence by trigger [message #652557 is a reply to message #652554] |
Mon, 13 June 2016 09:58 |
Bill B
Messages: 1971 Registered: December 2004
|
Senior Member |
|
|
Why do you care which one is the last row? If it really bothers you then add a column to the table to hold the session id and sort on both. However again, why do you care. A sequence only guarantees a unique Identifier for the row. Who cares otherwise.
|
|
|