Issue Details (XML | Word | Printable)

Key: DNET-552
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Erik Jan Meijer
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
.NET Data provider

ConnectionLifetime with value 0 (zero) is no longer treated as infinite but really as zero.

Created: 17/Apr/14 03:10 PM   Updated: 29/Dec/14 08:14 AM
Component/s: ADO.NET Provider
Affects Version/s:
Fix Version/s:

 Description  « Hide
In NETProvider\NETProvider\source\FirebirdSql\Data\FirebirdClient\FbConnectionPoolManager.cs , Pool.CleanupPool() does the following:

 var keep = available.Where(x => x.Created.AddSeconds(_connectionString.ConnectionLifeTime) > now).ToArray();

This does not take into account the default(!) value of zero for _connectionString.ConnectionLifeTime.

The effect is that connections are closed and recreated for every request.
You can see TCP-connections closing and new ones reopening by using TcpView by SysInternals.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura added a comment - 18/Apr/14 05:57 AM
Maybe it's also good to change the default value to something reasonable. Like 10 seconds. What you think?

Erik Jan Meijer added a comment - 22/Apr/14 06:49 AM
I think that depends on the situation, the context in which the connections are made and how much the connection will be used. Someone could want a lifetime of 10 seconds, but others 60 seconds or maybe longer, like infinite.

I'd say, don't change it and leave it to zero (i.e. infinite).