Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Timeout on SaveEntity
Message
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Timeout on SaveEntity
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01531836
Message ID:
01531836
Vues:
77
Hello all,

I have just created a new entity in my business application which records a commission percentage assigned to a customer order to one or many salespersons. It is a simple 3 column table (plus an integer identity PK). In order to fill this table I have added a HookPostSave event for my order entity. When the order is saved (on an add of an order), I will go to another table to get the defaults for the customer and load the commision values from there for the order. The code for this is as follows:
public void OrdrPostSave()
        {
            //  If this is not an add of a ordr, do not further allocate (use the createdtm to determine this)
            if (Entity.OrdrDtm.AddSeconds(10) < DateTime.Now)
                return;
            // Allocate to salesperson
            CompRep oCompRep = new CompRep();
            oCompRep.GetCompRepsByCompID(Entity.CompID);
            Comm oCommission = new Comm();
            foreach (CompRepEntity CRE in oCompRep.EntityList)
            {
                // Insert to comm table
                CommDefaults CDEF = new CommDefaults(Entity.OrdrID, CRE.RepID);
                oCommission.NewEntity(CDEF);
                oCommission.Entity.CommPct = CRE.CommRepPct;
                oCommission.SaveEntity();
            }
        }
However, when I run this I get a SQL timeout error on the SaveEntity line. Now, I tested running the save of the commission record by itself in a test bench and it works fine that way, but it doesn't when it is run as the post save event of the order, Please note that I am running the above method from the HookPostSaveEntity event of the Order object.

Any ideas as to why this is happening? And, if not, how can I determine in SQL, what might be the problem with the timeout. I can't seem to get any further information from SQL other than that the timeout has occurred.

TIA

Bob
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform