1 Reply Latest reply on May 8, 2014 8:41 AM by giocaputo

    How to implement Optimistic Concurrency with Oracle and Entity Framework ?

    giocaputo

      How can Entity Framework  use Optimistc Concurrency with Oracle? What kind of type can i use?

      I am using oracle Database 12c and Odp.Net 12.0.1

       

      Thanks

        • 1. Re: How to implement Optimistic Concurrency with Oracle and Entity Framework ?
          giocaputo

          I am tring to use it with this solution

           

          A table with Version column to handle a concurrency exception

           

          CREATE TABLE c##Test."Employees"

          (

            "Id" RAW(16) DEFAULT SYS_GUID() NOT NULL,

            "IdCity" RAW(16)  NULL,

            "IdOfficeCity" RAW(16)  NULL,

            "IdBirthPlace" RAW(16)  NULL,

            "IdPhoto" RAW(16)  NULL,

            "FirstName" VARCHAR2(64) NOT NULL,

            "MiddleName" VARCHAR2(64) NULL,

            "LastName" VARCHAR2(64) NOT NULL,

           

            "Version" TIMESTAMP DEFAULT SYSTIMESTAMP NOT NULL

          )

           

          In edmx Set manually on version column

               Concurrencymode=Fixed

             StoreGeneratedpatter=Computed

           

          I have created a trigger that before  INSERT/UPDATE FOR EACH ROW set  "Version" = sysdate

           

           

          When make an edit from two client i have this exception:

          A null store-generated value was returned for a non-nullable member 'Version' of type 'ApplicationModel.Employees'

           

          and not concurrency exception.

           

           

          Should be a good solution? and why is not throw a concurrency exception?

           

           

          Thanks