The timeout time has reached, but the connection has not been obtained from the pool. This may occur because all pool connections are in use and the maximum pool size is reached.

Source: Internet
Author: User
The timeout has reached. The timeout time has reached, but the connection has not been obtained from the pool. This may occur because all pool connections are in use and the maximum pool size is reached.
Note: An unhandled exception occurs during the execution of the current Web request. Check the stack trace information for details about the error and the source of the error in the code.

Exception details: system. invalidoperationexception: the timeout has reached. The timeout time has reached, but the connection has not been obtained from the pool. This may occur because all pool connections are in use and the maximum pool size is reached.

This is an old problem! You can check two points:
1. check whether all open connections are closed.
2. If the traffic volume is large and the Max pool size = 512 clause is added, of course, this is at the cost of system loss!
This will definitely solve your problem in the future!

Solution 1

I think it may be because of concurrent operations. Datareader is exclusively connected, that is, your program may be designed incorrectly. For example, if the maximum connection is set to 100 and 100 users use datareader to read the database content at the same time, the above error occurs when the connection pool is no longer connected when 101st users read the data. Datareader is exclusively connected, and each datareader occupies a connection. Of course, this happens occasionally, so it takes a long time, because only concurrent operations that exceed the maximum number of connections in the connection pool will occur. In addition, you can only temporarily reduce the number of concurrent connections. If you increase the number of concurrent connections to 200, what if there are 201 concurrent operations? You said that you can't use the close () method of the connection object, because the close () method only closes the connection, but this connection is not released and is still occupied by this object, to release a connection, you must use the dispose () method of the connection to explicitly release the connection. Otherwise, the connection occupied by this object can be released only when garbage collection occurs. In this case, the error "time-out has reached" will certainly occur.

Solution:
1. modify several key pages or frequently accessed database access operations. Use dataadapter and dataset to obtain database data. Do not use datareader.
2. Use the data cache on the page for accessing the database. If the data on the page is not updated frequently (updated several minutes), the cache object can be used without accessing the database, this greatly reduces the number of connections.
3. modify the code and call dispose () after close.
4. We recommend that you modify Database Operations to create your own database operation proxy class, inherit from the system. idisposable interface, and forcibly release resources. In this way, there will be no insufficient connections.

Solution 2

Solution (*): Web. in config: Add Max pool size = 512; server = Local; uid =; Pwd =; database = 2004; Max pool size = 512; "> once and for all.

Solution 3

It is estimated that the connection object is not close. You don't need to dispose, but datareader should be closed after it is used up, but it is okay if it is not closed, but the connection object will never be used, as long as you close the connection object, there will be no problems.

The operations of the connected object after open are put in the try block, followed by a Finally block: conn. Close ();

Error: 3154 is generally caused by the same database name specified during Database Backup recovery as the original database.
You specify a name that is not easy to repeat,
You can also specify the option to overwrite the existing database during restoration.

An error occurred while importing the SQL2000 database to sql2005. The error message is as follows:

Failed to restore the server "Edward \ Tracy. (Microsoft. sqlserver. SMO)

Click: http://go.microsoft.com/fwlink? For help information? Prod... er & linkid = 20476

------------------------------
Other information:

An exception occurred when executing a Transact-SQL statement or batch processing. (Microsoft. sqlserver. connectioninfo)

------------------------------

The database backup in the backup set is different from the existing \ 'foodgood \ 'database.
The Restore database is terminating abnormally. (Microsoft SQL Server, error: 3154)

Today, I am going to restore the sp. Bak backup database of SQL2000 to sql2005 (because SQL2000 is used in the classroom and sql2005 is installed in my computer. A problem occurs during restoration operations like SQL2000. It cannot be restored, and finally the method is fixed.

1. Create a new database in sql2005, such as: Product

2. Select the SQL2000 backup file to be restored.

3. It is very important to check the figure by selecting "override ...".

After restoring the database backed up by SQL2000 to sql2005, the "database relationship diagram" prompt: the database does not have a valid owner, so you cannot install the database relationship diagram support object. To continue, first set the database owner to a valid login name using the file page or the alter authorization statement in the "data database attributes" dialog box, and then add the database relational diagram support object.

The solution is as follows:
1. Set the compatibility level to 90 (2005 to 90)
Use [Master]
Go
Exec DBO. sp_dbcmptlevel at dbname = 'database name', @ new_cmptlevel = 90
Go

Or select the database you want to restore, right-click it, select Properties-> options-> Compatibility Level, select sqlserver2005 (90), and then click OK,

When you expand the "database relationship diagram" node under the database, you will be prompted, "This database lacks one or more support objects required to use the database relationship diagram, whether to create ", select "yes.

2. If the problem persists after performing the above operations, continue as follows:

Select your database, select "security"-> "user", and select DBO to open the attribute page. If the logon name is empty, create a new query and

Use [your database name]
Exec sp_changedbowner 'sa'

After the execution is successful, select the "database relationship diagram" node and prompt "this database lacks one or more support objects required to use the database relationship diagram, whether to create ", select "yes. You can see the previously created graph.

1. Separate two adjacent rows with different colors for the details in the table.

A: select the detail row of the table, select backgroundcolor In the attribute, select the expression for the value, and enter: = IIF (rownumber (nothing) mod 2, "White", "beige ").

2. Set the table header or end to be displayed on each side.

A: Select Table header or table footer and set repeatonnewpage In the attribute to true dot.

3. Each page displays the picture or title header information.

A: You only need to add the number of rows in the table header, put the content you want to display in the cell, and then set it in the second way.

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/lee576/archive/2008/02/24/2116360.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.