Using sequences and sorting of the entities creation in one transaction
Posted: Wed 23 Sep 2015 10:54
Dear supporters,
We have an ID column which is automatically populated by a sequence as below:
We are creating many entries of this entity in a row. For us is very important that if Entity A was created before entity B, the ID of entity A is smaller than the ID of entity B. Apparently when creating many entities this is not the case and it can be that the last created entity doesn't have the last sequence value.
Could you please confirm if this is the case?
If yes, is there any alternative to ensure that the sequence numbers obey the order that the entities where created in the code?
Thanks in advance.
We have an ID column which is automatically populated by a sequence as below:
Code: Select all
[Column(Name = @"ID", Storage = "_Id", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "NUMBER(9) NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
[Devart.Data.Linq.Mapping.SequenceGenerator(Sequence = "SEQ_PUMA_WORKFLOW_EXECUTION")]
public int Id
Could you please confirm if this is the case?
If yes, is there any alternative to ensure that the sequence numbers obey the order that the entities where created in the code?
Thanks in advance.