DmlOptions.InsertNullBehaviour.Omit - Bug

DmlOptions.InsertNullBehaviour.Omit - Bug

Postby 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
Species8372
 
Posts: 5
Joined: Wed 06 Apr 2011 13:45

Postby 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/index.php/new-features-of-entity-framework-support-in-dotconnect-providers.html#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.
Shalex
Devart Team
 
Posts: 7709
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle