Page 1 of 1

Master-Detail

Posted: Tue 03 Nov 2009 09:11
by halley73to
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?

Posted: Tue 03 Nov 2009 13:54
by AndreyR
Could you please provide a code sample illustrating actions leading to this error?

Posted: Wed 04 Nov 2009 08:08
by halley73to
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();

Posted: Wed 04 Nov 2009 08:13
by halley73to
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 =

Posted: Fri 06 Nov 2009 09:15
by halley73to
Solved,
5.35 beta don't do this. :D

Posted: Fri 06 Nov 2009 10:54
by Shalex
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.