Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HandleException Bug?
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
HandleException Bug?
Divers
Thread ID:
00816629
Message ID:
00816629
Vues:
57
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;
}
Brian Burlingame
Software Engineer/Consultant
Olympic Consulting Group
brian.burlingame@ocgworld.com
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform