Unexplained Behaviour of Sequence in Oracle
Posted: Mon 30 Sep 2013 09:32
Dear all
I am using dotConnect For Oracle version 6.60.268.
I create a sequence in Oracle 10g as below:
CREATE SEQUENCE MYSEQUENCE
MINVALUE 0 MAXVALUE 999999999999999 INCREMENT BY 1
START WITH 1 CACHE 100 NOORDER NOCYCLE;
Then in my .NET code, I have integrated the dotConnect For Oracle into the Enterprise library and this is how I get the sequence value:
Return DirectCast(oDalc.RunDirectSQLScalar("SELECT MYSEQUENCE.NEXTVAL FROM DUAL"), Decimal)
Now is the unexplained part:
I have 2 separate .NET exe which will get the sequence value at the same time. The first program get 1 and the second program get 100. This is not what I expected.
I expect the first program get 1 and the second program get 2.
Is there anything wrong with the version of dotConnect For Oracle or is there anything wrong with the sequence that I create?
Please kindly advise.
Thanks
I am using dotConnect For Oracle version 6.60.268.
I create a sequence in Oracle 10g as below:
CREATE SEQUENCE MYSEQUENCE
MINVALUE 0 MAXVALUE 999999999999999 INCREMENT BY 1
START WITH 1 CACHE 100 NOORDER NOCYCLE;
Then in my .NET code, I have integrated the dotConnect For Oracle into the Enterprise library and this is how I get the sequence value:
Return DirectCast(oDalc.RunDirectSQLScalar("SELECT MYSEQUENCE.NEXTVAL FROM DUAL"), Decimal)
Now is the unexplained part:
I have 2 separate .NET exe which will get the sequence value at the same time. The first program get 1 and the second program get 100. This is not what I expected.
I expect the first program get 1 and the second program get 2.
Is there anything wrong with the version of dotConnect For Oracle or is there anything wrong with the sequence that I create?
Please kindly advise.
Thanks