SemaphoreFullException exception in SQLHelper class within a WCF service

Discussion in 'ASP .Net Web Services' started by John Dow, Feb 10, 2009.

  1. John Dow

    John Dow Guest

    I have a IIS hosted WCF Service which uses SqlHelper class from DAAB version
    2.0 in the data layer

    Once in a while, it throws exception at this line:

    Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteReader()
    Type: System.Runtime.InteropServices.COMException
    Message: The handle is invalid. (Exception from HRESULT: 0x80070006
    (E_HANDLE))

    In the IIS server (6.0), the application pool gets recycled. And the event
    log show following error message:

    An unhandled exception occurred and the process was terminated.

    Application ID: /LM/W3SVC/671226/Root/WCFMerchant

    Exception: System.Threading.SemaphoreFullException

    Message: Adding the given count to the semaphore would cause it to exceed
    its maximum count.

    StackTrace: at System.Threading.Semaphore.Release(Int32 releaseCount)
    at System.Data.ProviderBase.DbConnectionPool.CleanupCallback(Object
    state)
    at System.Threading._TimerCallback.TimerCallback_Context(Object state)
    at System.Threading.ExecutionContext.runTryCode(Object userData)
    at
    System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
    code, CleanupCode backoutCode, Object userData)
    at System.Threading.ExecutionContext.RunInternal(ExecutionContext
    executionContext, ContextCallback callback, Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext
    executionContext, ContextCallback callback, Object state)
    at System.Threading._TimerCallback.PerformTimerCallback(Object state)

    Anyone has any idea why this error occurs? Is there any problem to use the
    SQLHelper class which mostly in static methods from WCF service
    (multithreaded)? If that is the case, any solution to fix it without
    greatly reconstruct my project ?
     
    John Dow, Feb 10, 2009
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Ymlj?=

    sqlHelper exception handling

    =?Utf-8?B?Ymlj?=, Oct 4, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    1,698
    sloan
    Oct 8, 2007
  2. Billy Zhang
    Replies:
    7
    Views:
    1,630
    Steven Cheng [MSFT]
    Jul 31, 2008
  3. John Dow
    Replies:
    0
    Views:
    975
    John Dow
    Feb 11, 2009
  4. Simon
    Replies:
    0
    Views:
    1,272
    Simon
    Oct 13, 2009
  5. Cindy Lee
    Replies:
    1
    Views:
    3,182
    Mr. Arnold
    Mar 19, 2010
  6. Curt K
    Replies:
    3
    Views:
    695
    John Saunders [MVP]
    Jun 15, 2007
  7. kellygreer1

    Web Service versus WCF Service (and Books)

    kellygreer1, Nov 8, 2007, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    284
    Andrew Faust
    Nov 9, 2007
  8. mike

    Windows Service as Web Service host without WCF?

    mike, Mar 30, 2009, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    934
Loading...