Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Timeout on SaveEntity
Message
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Timeout on SaveEntity
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01531836
Message ID:
01531836
Views:
75
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
Next
Reply
Map
View

Click here to load this message in the networking platform