DmlOptions.InsertNullBehaviour.Omit - Bug

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
Species8372
Posts: 5
Joined: Wed 06 Apr 2011 13:45

DmlOptions.InsertNullBehaviour.Omit - Bug

Post by Species8372 » Mon 20 Feb 2012 15:36

Hello,

i am using the current Version 6.70.

When using the following setting:

OracleEntityProviderConfig.Instance.DmlOptions.InsertNullBehaviour = InsertNullBehaviour.Omit;

it is not possible to insert an empty Entity, e.g.

MYEntity e = new MYEntity();
context.Add(e);
context.SaveChanges(); <- Error at this point

MYEntity is completely empty, i want to have an empty row in my database with null-values only (except the primary key).

I guess the insert does something like "Insert into myentity () values()" ?!

Greetings,

Species8372

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Tue 21 Feb 2012 15:53

As we understood, the value for the primary key column is generated in your database (sequence + trigger). If so, set StoreGeneratedPattern=Identity for your primary column in the store part of the model.

If not, please specify the following information:
- the exact text of the error
- turn on the dbMonitor tool and check the actual query
Download link: http://www.devart.com/dbmonitor/dbmon3.exe
Documentation: http://www.devart.com/dotconnect/oracle ... nitor.html

Refer to http://www.devart.com/blogs/dotconnect/ ... l#OtherDML: try specifying devart:DefaultValue="MY_SEQUENCE.NEXTVAL" (if there is a corresponding sequence for your primary key in the database) and using InsertNullBehaviour.InsertDefaultOrOmit.

Post Reply