Resources » .NET programming » ASP.NET/Web Applications

Adding the specified count to the semaphore would cause it to exceed its maximum count. c#


Posted Date: 05-Mar-2012  Last Updated:   Category: ASP.NET/Web Applications    
Author: Member Level: Gold    Points: 10


Adding the specified count to the semaphore would cause it to exceed its maximum count. C# An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. This exception is cuased when the max no of connection pool is reached.



Semphore adding overview


Adding the given count to the semaphore would cause it to exceed its maximum count.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

For this error to occur there are two reasons

1. you might have public the solution by keeping the debug points in the .cs/.vb pages,

solutions: a.publish removing the debug points
b. in web.config file




< configuration >
< system.web>
< compilation debug="true"/>
</ system.web>
< /configuration>




2. Too much pooling will cause the semaphore overflooded.
in web.config connection string just specidy the pooling='false'



<add key="ConnectionString" value="Data Source=abc;user id=sa;password=pwd;database=dbname;pooling='false';" />




Description


A Connection Pool is maintained internally by the Connection Pool Manager. When a request for a subsequent connection comes in, the Connection Pool Manager searches the pool for the availability of a free connection and returns it to the application if one is available.

1.If any unused connection is available, it returns one. 2.If all connections are used up, a new connection is created and added to the pool. 3.If the number of connections reaches the maximum number of connections in the pool.
Connection pooling is enabled by default.

Data Source=TestServer;Initial Catalog=Northwind; User ID=Chester;Password=Tester;Pooling=False;


Did you like this resource? Share it with your friends and show your love!

Responses to "Adding the specified count to the semaphore would cause it to exceed its maximum count. c#"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    Pawan Awasthi
    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India