InsertNullBehaviour.InsertDefaultOrNull not working in build server

InsertNullBehaviour.InsertDefaultOrNull not working in build server

Postby bhav27 » Tue 19 Aug 2014 09:20

We have a problem with dot connect of oracle when using EF6. In the stored file for .edml file generated we set following.

Code: Select all
<Property Name="ADDRESS_ID" Type="int64" Nullable="false" devart:DefaultValue="DDD_ADDRESS_ID.NEXTVAL" StoreGeneratedPattern="Identity" />


The Address_Id is populated correctly when record is saved in my local PC. However when we deploy this code using TFS build script the application do not generate correct insert sql as it do not include Address_id in the sql.

We get back database error due to this since key value cannot be inserted as null. I have installed EntityFramework dll in the project from Nuget package which I restored in the solution for TFS build. Everything else works fine for EF6 just the storedgeneratedpattern does not work. Am I missing anything? Here is the generated SQL

Code: Select all
DECLARE
  updatedRowid ROWID;
BEGIN
INSERT INTO AGTAPP.DDD_CONTACT(ROLE, FIRST_NAME, LAST_NAME, PHONE, MOBILE, FAX, EMAIL, QC_REPORT_CONTACT, LAST_UPDATED_BY)
VALUES (NULL, :p0, :p1, NULL, :p2, NULL, NULL, NULL, :p3)
RETURNING ROWID INTO updatedRowid;
OPEN :outParameter FOR SELECT DDD_CONTACT_ID, LAST_UPDATED_DATE FROM AGTAPP.DDD_CONTACT WHERE ROWID = updatedRowid;
END;


Code: Select all
            // Here we configure the EF-provider, so that the default values defined in the model are used
            var config = OracleEntityProviderConfig.Instance;
            config.DmlOptions.InsertNullBehaviour = InsertNullBehaviour.InsertDefaultOrNull;

            _context = new DDDEntities();


Looking at the assemblies generated by TFS build (using .net reflector) I can see .csdl, .msl and .ssdl resources being correctly embedded. What is build server missing for EF6?
bhav27
 
Posts: 20
Joined: Tue 20 Apr 2010 11:53

Re: InsertNullBehaviour.InsertDefaultOrNull not working in build server

Postby Shalex » Wed 20 Aug 2014 12:35

bhav27 wrote:The Address_Id is populated correctly when record is saved in my local PC. However when we deploy this code using TFS build script the application do not generate correct insert sql as it do not include Address_id in the sql.

The further correspondence was carried out by email.
The reason of the problem was different versions of Devart.Data.Oracle.Entity.dll used in projects in local PC and TFS server.
Shalex
Devart Team
 
Posts: 7781
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle