[Mono-bugs] [Bug 661644] New: ConstraintException after DbTableAdapter.Update()

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Dec 28 15:48:52 EST 2010


https://bugzilla.novell.com/show_bug.cgi?id=661644

https://bugzilla.novell.com/show_bug.cgi?id=661644#c0


           Summary: ConstraintException after DbTableAdapter.Update()
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.8.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Data
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: crokusek at pacbell.net
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:

Using xsd generation, modify a DataRow, call Update, then toggle
enforceconstraints to do a consistency check, getting an ConstraintException
thrown for Mono on Linux and Windows but not native Windows.


Steps to reproduce the problem:
1. Create table with three-col PK and a field (don't know if #PK cols matters) 
2. Drag it into the .xsd designer in MSVS 2008.
3. Save the .xsd file
4. run xsd <file>.xsd /d to generate the .cs for the dataset
5. xsd_genTableAdapter taParms = new xsd_genTableAdapter(); 
6. Run this code 

// DS is dataset from .xsd, 
// taParms is tableadapter for the table "parms" 

DS ds = new DS(); 
taParms.Fill(ds.parms);               // read some rows from db 

DS.parmsRow r = ds.parms[1];          // pick any row 
r.some_field++;  // change any field, doesn't matter if it is a key or not 

taParms.Update(ds.parms);             // write changes to db 

// Work-arounds: 
//       Re-reading the parms table after update from the database 
//       taParms.Update(ds.parms.Copy()); 

ds.EnforceConstraints = false;   // toggle
ds.EnforceConstraints = true;    // throws ConstraintException


Actual Results:

Field in database is updated but the dataset is corrupt in that
EnforceConstraints cannot be set to true.  Causes problems with other tables in
the dataset if any.


Expected Results:

No exception.



How often does this happen? 

Everytime.



Additional Information:

I believe the problem is that the DbDataAdapter::Update() is corrupting the
indexes.  The particular test case is using a 3-col PK if that makes any
difference.  Using Mono 2.8.1 windows and linux builds both fail.  Works great
on native non-mono windows.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list