Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stored Procedure Failed Not Caught by MM.NET
Message
De
14/03/2009 12:35:21
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
12/03/2009 23:25:59
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01387586
Message ID:
01388064
Vues:
62
Hi Juan,

How are you calling SaveEntity()? Can you post the method where you are calling this so I can match what you are doing? I will try to recreat this situation and step through it to see what happens. I will let you know what I find.
Tim

>Hi folks!
>
>I've a horror story to share, maybe there's somebody who can shed some light.
>
>The Problem: When using SaveEntity, if the associated SP fails, the BO does not report any errors, as a matter of fact continues as if everything went ok.
>
>The Result: The user thinks the record was saved, but in reality it wasn't because the SP failed.....(screaming!)
>
>The aftermath: since I'm using AutoUseTransaction = false, after the saveentity is invoked, when trying to add new entity I get another error because the existing entity did not get "clean".
>
>In other words, the BO doesn't seem to catch the ADO notification that the SP failed.
>
>You may ask at this point, but how did you know that the SP failed if the BO did not report any errors?
>
>Well, I realized of this because the SP in question was failing when trying to insert a DBNull value to a column of type varbinary(MAX), which I solved by following this link
>http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/e61f0616-0866-4f3f-aeba-6a76e144e169/
>
>Then, who knows why, maybe it is the pessimist I carry in the bottom of my soul, I typed RAISERROR at the beginning of the SP. Boom.
>
>As additional info, I've tried the following:
>
>(1) I've forced an error on the SP by adding a RAISEERROR at the beginning of it,
>(2) built a couple of test on NUnit with different BOs of my app all trying to use saveentity or insert with SPs that have the raiserror line: all of them with the same results (Basically the saveentity method executes fine, but the data obviously does not get saved because of (1),
>(3) I've built separate methods using plain ADO.NET code against the same SP (same Nunit session) and in this case the error comes up, so this tells me it is not an ADO.NET bug.
>
>Any ideas? Is this a mm.net bug or is this a feature? <vbg>
>
>TIA
>Sleepless in DC.
Timothy Bryan
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform