Problem with a sequence generated id in Oracle

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
Posts: 48
Joined: Tue 17 Jan 2006 13:57
Location: Switzerland, Sion

Problem with a sequence generated id in Oracle

Post by labate » Thu 28 Oct 2010 08:08

Hello devart,

When I add a new entity object into Oracle, the record is created. However I noticed the entity is not refreshed with the new ID generated on the server.

Code: Select all

using (MyEf4Entities ctx = new MyEf4Entities())
    var person = new Person
        Name = "MyName", 

Before the SaveChanges(), PersonId is 0, the state is Added and the entitykey is set to temporary is true.
After the SaveChanges(), PersonIs is still 0, the state is Unmodified and the entitykey is set to temporary is false.

Of course, PersonId is the key and its property StoreGeneratedPattern is set to true.
A trigger exist:

Code: Select all

before insert on person
for each row
select mspak.seq_personid.nextval into :new.personid from dual;
This problem seems very trivial. Is there something I missed?

We work with dotConnect for Oracle Pro,, Oracle 11g

Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 28 Oct 2010 13:06

I have made a simple test and everything succeeded.
Could you please send us (support * devart * com, subject "EF4 StoreGeneratedPattern") a small test project illustrating the situation?

Post Reply