[Mono-bugs] [Bug 77749][Maj] New - Crash when committing DataSet
changes to database
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Thu Mar 9 16:00:03 EST 2006
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by prensing at cimetrics.com.
http://bugzilla.ximian.com/show_bug.cgi?id=77749
--- shadow/77749 2006-03-09 16:00:03.000000000 -0500
+++ shadow/77749.tmp.3723 2006-03-09 16:00:03.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 77749
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: Sys.Data
+AssignedTo: tsenganal at novell.com
+ReportedBy: prensing at cimetrics.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Crash when committing DataSet changes to database
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+I have a DataSet with a number of tables and foreign key constraints. I add
+some rows to table A. I then add rows to a "child" table B, with the new
+rows pointing at the new rows in A. I then do a dataAdapter.Update(tableA).
+This generates an exception:
+
+Unhandled Exception: System.ArgumentOutOfRangeException: Argument is out of
+range.
+in <0x0009c> System.Collections.BitArray:Get (Int32 index)
+in <0x0000d> System.Collections.BitArray:get_Item (Int32 index)
+in <0x0001b> System.Data.Common.AbstractDataContainer:IsNull (Int32 index)
+in <0x0000e>
+System.Data.Common.AbstractDataContainer+Int32DataContainer:get_Item (Int32
+index)
+in <0x0017e> System.Data.DataRow:CheckChildRows
+(System.Data.ForeignKeyConstraint fkc, DataRowAction action, Rule rule)
+in <0x00244> System.Data.DataRow:CheckChildRows (DataRowAction action)
+in <0x002b8> System.Data.DataRow:EndEdit ()
+
+Looking at the DB, the first new row of A has been inserted, so the error
+occurs after that. I believe the problem occurs when the DataAdapter reads
+back the inserted row from the database and tries to patch that into the
+DataSet.
+
+Steps to reproduce the problem:
+1. DataSet to two tables and a foreign key relation
+2. Add new rows to both tables and connect them with a FK.
+3. Commit to the DB.
+
+Actual Results:
+It throws an exception.
+
+Expected Results:
+
+
+How often does this happen?
+Always.
+
+Additional Information:
+In my code, the primary key column is AutoIncrement. So, before the commit,
+it has some large, arbitrary value. After insertion into the database, it
+will have a new primary key. Presumably the code needs to go through the
+child rows and change the key and that is not happening correctly.
+
+I looked at the code. I am not clear on how it is happening, but the call
+to "EndEdit()" at the very start of DataRow.AcceptChanges() seems suspicious.
More information about the mono-bugs
mailing list