Master-Detail

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
halley73to
Posts: 29
Joined: Wed 07 Oct 2009 07:24

Master-Detail

Post by halley73to » Tue 03 Nov 2009 09:11

Hi,
using LinqToOracle in a master detail scenario, if i add detail row and then i remove the same row, when i call SubmitChanges the provider try to insert null row that raise an exception.

What can i do?

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

Post by AndreyR » Tue 03 Nov 2009 13:54

Could you please provide a code sample illustrating actions leading to this error?

halley73to
Posts: 29
Joined: Wed 07 Oct 2009 07:24

Post by halley73to » Wed 04 Nov 2009 08:08

DataContext1.Table1 tab1 = FDb.Table1s.First();

tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());
tab1.Table2s.Add(new DataContext1.Table2());

while (tab1.Table2s.Count() > 0)
tab1.Table2s.RemoveAt(0);

FDb.Log = Console.Out;

FDb.SubmitChanges();

halley73to
Posts: 29
Joined: Wed 07 Oct 2009 07:24

Post by halley73to » Wed 04 Nov 2009 08:13

An the output windows diplay this:

INSERT INTO MAGAZZINO.TABLE2 (ID_TABLE1, CODICE, DESCRIZIONE) VALUES (:p1, :p2, :p3) RETURNING ID INTO :ret1
ParameterName = p1
DbType = Decimal
Value =
ParameterName = p2
DbType = String
Value =
ParameterName = p3
DbType = String
Value =
ParameterName = ret1
DbType = Decimal
Value =

halley73to
Posts: 29
Joined: Wed 07 Oct 2009 07:24

Post by halley73to » Fri 06 Nov 2009 09:15

Solved,
5.35 beta don't do this. :D

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 06 Nov 2009 10:54

We have reproduced the issue with removing entities from EntitySet without explicit call of InsertOnSubmit (the removed records are inserted into database with the 5.35.52 version of dotConnect for Oracle). The problem is fixed. Look forward to the next build of dotConnect for Oracle.

Post Reply