Page 1 of 1

Default value for identity/computed properties in 6.50.250.0

Posted: Thu 08 Dec 2011 17:12
by bakgerman
Setting the values of identity and computed properties in Ef without triggers, as described here: http://www.devart.com/blogs/dotconnect/?p=5444, does not work in the 6.50.250.0 release. We had to rollback to our previous install of 6.30.202.0 to make this work again. We were getting errors on inserts from oracle stating "Unable to insert NULL into non-nullable [TableName].ADD_DATE" when this was defined as an identity property with a default value of SYSDATE in the EDML file. We use this feature extensively and were able to remove 90% of our triggers. Without this working properly we cannot upgrade. The feature was working before I upgraded to 6.50.250.0, not working (in all cases a default was specified in the EDML file on an identity/computed property, this error was not specific to 1 table), and then worked again after I rolled back to 6.30.202.0. So it seems this is a serious regression in the update.

Posted: Fri 09 Dec 2011 15:55
by Shalex
We cannot reproduce the problem with x.250.
1. Open your *.edml with XML Editor and make sure that your ID column in SSDL has the following attributes:
devart:DefaultValue="SYSDATE" StoreGeneratedPattern="Identity".
2. Configure the EF-provider before creating your context, so that the default values defined in the model are used:

Code: Select all

  var config = OracleEntityProviderConfig.Instance;  
  config.DmlOptions.InsertNullBehaviour = InsertNullBehaviour.InsertDefaultOrNull;
The new (6.60.258) version of dotConnect for Oracle is available for download.

Posted: Mon 12 Dec 2011 22:54
by bakgerman
Shalex wrote:We cannot reproduce the problem with x.250.
1. Open your *.edml with XML Editor and make sure that your ID column in SSDL has the following attributes:
devart:DefaultValue="SYSDATE" StoreGeneratedPattern="Identity".
2. Configure the EF-provider before creating your context, so that the default values defined in the model are used:

Code: Select all

  var config = OracleEntityProviderConfig.Instance;  
  config.DmlOptions.InsertNullBehaviour = InsertNullBehaviour.InsertDefaultOrNull;
The new (6.60.258) version of dotConnect for Oracle is available for download.
I had already done the data model and the providerConfig as you stated above from the early days on our project, so that wasn't the problem.
The new 6.60 download fixed the columns with SYSDATE filling in as the default value. Thank you.
Nonetheless, the columns with a default value of USER are now not filling in, which I also saw in 6.50 when I manually set the affected Date column to DateTime.Now in the C# code.
So, I think there is an issue with the handling of default values in the data model, at least when it comes to Oracle databases. I will still have to rollback to 6.30 to continue our team's development until this is addressed fully.

Posted: Wed 14 Dec 2011 08:26
by Shalex
We have reproduced the problem and are investigating it.

Posted: Wed 14 Dec 2011 22:38
by bakgerman
Shalex wrote:We have reproduced the problem and are investigating it.
Great, thanks, much appreciated

Posted: Fri 16 Dec 2011 11:38
by Shalex
The bug with config.DmlOptions.InsertNullBehaviour for non-EntityKey columns with initialized DefaultValue and StoreGeneratedParttern is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Posted: Fri 16 Dec 2011 15:30
by bakgerman
Shalex wrote:The bug with config.DmlOptions.InsertNullBehaviour for non-EntityKey columns with initialized DefaultValue and StoreGeneratedParttern is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.
Thank you very much. :) Regression defects are annoying but a fact of life. Your support is very quick in its turnaround time.

Posted: Thu 22 Dec 2011 17:18
by Shalex
New build of dotConnect for Oracle 6.60.268 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22977 .