I think there may be an issue with the mmBusinessObject "HandleException()" method. I've been noticiing that when I call SaveDataSet() on a business object that encounters a database exception, the existing transaction is not being rolled back. This seems to leave locks on the table.
After looking at the code, it appeared that the intent was to automatically rollback the transaction, but the exception is instead re-thrown (see below). The caller (mmBusinessObject.SaveDataSet()) is supposed to rollback the transaction if an exception is encountered. Isn't this a bug?
// See the "throw e" statement...
public virtual void HandleException(Exception e)
{
if (e is DBConcurrencyException)
{
// Build a concurrency exception message
DBConcurrencyException dbEx = (DBConcurrencyException)e;
this.ConcurrencyExceptionMsg =
this.BuildConcurrencyExceptionMsg(dbEx);
}
else
{
this.ConcurrencyExceptionMsg = null;
throw e; // ??? BUG HERE ???
}
// Store the exception at the business object level
this.Exception = e;
// Set to null since this IS the exception business object
this.ExceptionObject = null;
}