Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's up with Concurrency and MM .NET (GetConflictData???)
Message
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
What's up with Concurrency and MM .NET (GetConflictData???)
Miscellaneous
Thread ID:
01317518
Message ID:
01317518
Views:
89
I've read in the help under the section entitled "Handling Concurrency Errors" and I've created a Windows forms demonstration project using the employees table from the Pubs database and I'm getting strange results, indeed!

The help in this section says:

"To retrieve the current data in the database, the business object's GetConflictData method is called to return a DataRow containing the current values."

However, when I run GetConflictData(this.employee.datarow) it ends up changing the values of the data in the backend. I did not run the form's Save method at all and my backend data got changed.

Here's my simple program:

private void mmButtonSave1_Click(object sender, EventArgs e)
{
DataSet myconflict = this.Employee.GetConflictData(this.Employee.DataRow);
DataTable dt = myconflict.Tables[0];
DataRow dr = dt.Rows[0];
string fname = dr.ItemArray[1].ToString();
}

The value of fname is always the name from the form that I just changed it too. It's never what was current in that backend, which I changed in Query Analzyer to something entirely different.

I don't understand how concurrency is supposed to work in MM .NET where the help says:

********************************
Changing Default Concurrency Handling Behavior

There are a number of ways you can change the default MM .NET concurrency handling behavior:

Override the business object's HandleException method, check for DBConcurrencyException, and perform completely different handling logic

Override the business object's BuildConcurrencyExceptionMessage method to change how the exception message is built

Override the business object's GetConflictData method to change the way conflicting concurrency data is retrieved from the database
********************************

Exactly, what is the default behavior? Right now all I see is that GetConflictData isn't doing what I would think it should do at all. It's changing the backend data. How can that be correct?
Next
Reply
Map
View

Click here to load this message in the networking platform