Results 1 to 5 of 5

Thread: [Resolved-ish][2008] WCF Service timing out randomly

Threaded View

  1. #1

    Thread Starter
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Resolved [Resolved-ish][2008] WCF Service timing out randomly

    I'm currently in the process of developing a forum system that uses a WCF server to get, process and store data.

    For the most part, it works like a charm, I have a pretty basic 3-tier model running in the background on the service and using data contracts to access whatever functionality I need.

    My problem is, that sometimes when getting data from my service, it just starts to hang, until it hits the 1 minute timeout, and I can't seem to figure out why.

    I always ensure that my service proxy's are closed, and I've even tried creating a while loop that ran til the state of the proxy's connection was closed, as to insure the object wasn't cached or some crazy thing like that I couldn't control.

    I've tried making a simple for loop(100 iterations), that calls a method on the service which returns a simple string - this it can do fast, with no problems what so ever.

    So I thought it might have something to do with my database connectivity. It just seems rather unlikely, since I also always ensure I'm closing down my database connections(I use the same method to access a plethora of procedures in my database - look below):

    Code:
            public DataTable CallStoredProcedure(string ProcedureName, bool query)
            {
                FbDataReader fbRead = null;
                var fbConn = new FbConnection(ConnectionString);
                var cmd = new FbCommand(ProcedureName, fbConn);
                cmd.CommandType = CommandType.StoredProcedure;
                foreach (var arg in ProcedureArguments)
                {
                    cmd.Parameters.Add(arg.Name, arg.Value);
                }
                cmd.Connection.Open();
                try
                {
                    if (query)
                    {
                        fbRead = cmd.ExecuteReader();
                        var dt = new DataTable();
                        dt.Load(fbRead);
                        return dt;
                    }
                    else
                    {
                        cmd.ExecuteNonQuery();
                    }
                }
                finally
                {
                    ProcedureArguments.Clear();
    
                    cmd.Connection.Close();
                    while (cmd.Connection.State != ConnectionState.Closed) { }
                }
                
                return null;
            }
    I'm using a Firebird database, which my company has tried and tested in a production environment for several years without any problems.

    Neither me, nor any of my colleagues can seem to figure this out, and it's rather frustrating.

    Oh, one more thing - the problem seems to occur more frequently when I load my data through an AJAX update panel.

    Any help or thoughts is greatly appreciated.
    Last edited by vbNeo; May 26th, 2008 at 02:29 PM.
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width