dotConnect Oracle 5.55beta wrestles with INSERT

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
PangoChris
Posts: 12
Joined: Mon 14 Sep 2009 20:11

dotConnect Oracle 5.55beta wrestles with INSERT

Post by PangoChris » Wed 10 Feb 2010 20:28

The new version of dotConnect for Oracle has introduced a LINQ to SQL bug in which calling SubmitChanges() to insert multiple rows into the same table crashes.

I don't have time to isolate and produce sample code, but dbMonitor tells the story and reverting to the previous version fixes the issue.

The table being inserted into has a standard primary key that gets autogenerated off of a number sequence. The correct properties have been set for the table in the LINQ to SQL model, as it worked prior to the latest dotConnect version. When SubmitChanges() is called with more than one new record to be inserted into the table, according to dbMonitor, the *first* INSERT works as expected:

INSERT INTO table (field1, field2) VALUES(:p1, :p2) RETURNING primaryKey INTO :ret1

The database correctly returns into :ret1, say 100.

The *second* INSERT bombs, as it unwisely tries to reuse the return value from the *first* INSERT as the primary key for the second record. Yikes. So this happens:

INSERT INTO table (field1, field2, primaryKey) VALUES(:p1, :p2, :p3) RETURNING primaryKey INTO :ret1

and dotConnect is setting :p3 to 100, so Oracle explodes because obviously that conflicts with the record we just tried to insert a second ago.

Hope that's enough info to reproduce. I was unable to persuade my client that their database already has all the rows they'll ever need.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 11 Feb 2010 15:30

Thank you for the report, we are investigating the situation.

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 16 Feb 2010 17:09

We have fixed the problem. The fix will be available in the nearest build.

Post Reply