Search found 5 matches

by Raghu
Sat 16 Jun 2018 13:50
Forum: dotConnect for Oracle
Topic: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First
Replies: 14
Views: 111652

Re: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First

Shalex wrote: Fri 15 Jun 2018 16:46 You should map the DOJ column type explicitly: .HasColumnType("timestamp");
After this, the DOJ column in database will have milliseconds information.
I have mapped DOJ column as TIMESTAMP explicitly even then milliseconds value is saved/retrieved as zero's.

modelBuilder.Entity<Sample>()
.Property(b => b.DOJ)
.HasColumnName("DOJ").HasColumnType("timestamp").IsConcurrencyToken();
}

I will modify sample application that was shared with me to replicate the issue and share the same with you asap.

thanks.
by Raghu
Wed 13 Jun 2018 16:23
Forum: dotConnect for Oracle
Topic: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First
Replies: 14
Views: 111652

Re: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First

I have not received any mail regarding this. please let me know in post if any additional information required.

Below are the steps to replicate issue easily :

1. create a table in oracle DB using this script
create table sample(ID number(12),DOJ TIMESTAMP)

2.Insert a record in to table with EF code first with both dotConnect versions
with version 9.5.454.0 DOJ column value will be inserted as: Ex:10-Sep-02 14:10:10.000000
with version 8.5.616.0 DOJ column value will be inserted as: Ex:10-Sep-02 14:10:10.458956
Milliseconds value will be inserted as zero with 9.5.454.0 and even with latest version 9.5.520

3. Even when we try to retrieve value of DOJ column Milliseconds value retrieved as zero's with 9.5.454.0

Thanks.
by Raghu
Fri 08 Jun 2018 19:05
Forum: dotConnect for Oracle
Topic: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First
Replies: 14
Views: 111652

Re: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First

I found exact root cause for this issue :
With devart dotConnect(V 9.5.454.0) Insert/Update/Select operations on oracle DB column of type TIMESTAMP the milliseconds value retrieved/updated as Zero's(Ex:10-Sep-02 14:10:10.000000) instead of actual value.

It is not possible to share sample application but i can post the steps to reproduce the issue:

1. Create table with at-least one column of type TIMESTAMP and insert sample data into it. PFB script :
create table sample(ID number(12),NAME varchar2(32),AMOUNT number(12),DOJ TIMESTAMP)
insert into sample values(1,'test data',100,systimestamp)


2. Define an entity and configure DOJ column with IsConcurrencyToken()
Ex: protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Sample>()
.Property(b => b.DOJ)
.HasColumnName("DOJ").IsConcurrencyToken();
}


3. Update amount column of sample table
Ex: var data =DbContext.Set<Sample>().Where(t => t.Id == 1).FirstOrDefault();
data.Amount = 200;
DbContext.Entry(data).State = EntityState.Modified;
DbContextContext.SaveChanges();


Upon performing update operation on column using devart dotConnect(V 9.5.454.0) it throws below exception:

Exception : Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded.

Same scenario is working fine with Devart dotConnect (V 8.5.616.0)

Please let me know the resolution at earliest.

Thanks.
by Raghu
Thu 07 Jun 2018 19:22
Forum: dotConnect for Oracle
Topic: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First
Replies: 14
Views: 111652

Re: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First

I have not received any test project on my registered mail ID.
If possible can you resend it again and let me know how to send it back after modification.

Thanks.
by Raghu
Wed 06 Jun 2018 12:18
Forum: dotConnect for Oracle
Topic: DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First
Replies: 14
Views: 111652

DbUpdateConcurrencyException when using Devart dotConnect (9.5.454.0) with Oracle in EF Code First

I have an entity class in which few columns have IsConcurrencyToken() configuration defined on them.
For most of entites IsConcurrencyToken() is defined on column type DATE.
Ex: this.Property(t => t.column_name).HasColumnName("column_name").HasColumnType("DATE").IsConcurrencyToken();

Any save operation on this object is resulting in DbUpdateConcurrencyException.
I was able to save the object if i remove IsConcurrencyToken() on defined columns though.

I am facing this issue after migrating from Devart dotConnect 8.5.616 to 9.5.454.0; same scenario is working fine with Devart dotConnect (V 8.5.616.0)

Below are the exception details:
An exception of type 'System.Data.Entity.Infrastructure.DbUpdateConcurrencyException' occurred and was caught.

Type : System.Data.Entity.Infrastructure.DbUpdateConcurrencyException, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded.

Any help on this is highly appreciated.

Thanks.