SCM

[#1010193] NpgsqlConnectionString caching support patch

View Trackers | Patches | Download .csv | Monitor

Date:
2007-11-21 10:22
Priority:
3
State:
Open
Submitted by:
Tao Wang (dancefire)
Assigned to:
Nobody (None)
Category:
Group:
Resolution:
None
 
Summary:
NpgsqlConnectionString caching support patch

Detailed description
This patch is adding caching ability to NpgsqlConnectionString class. It will improve the NpgsqlConnectionString.ParseConnectionString() function for recent parsed connection strings.

Following functions are added to NpgsqlConnectionString class:

private static NpgsqlConnectionString LookupCached(string CS);
private static void CacheCS(string CS, NpgsqlConnectionString obj);

And a public property for setting cache size are added:

public static int CacheSize{get; set;}

And NpgsqlConnection.ChangeDatabase() also be modified to avoid broken ChangeDatabase() function.

A test case, ChangeDatabaseTestConnectionCache(), is added to test calling ChangeDatabase() will never affect other connections which sharing same NpgsqlConnectionString object.

This patch is based on Npgsql2.0beta1 src.

Followup

No Followups Have Been Posted

Changes:

Field Old Value Date By
File Added265: ConnectionTest.cs.patch2007-11-21 10:23dancefire
File Added264: NpgsqlConnectionString.cs.patch2007-11-21 10:23dancefire
File Added263: NpgsqlConnection.cs.patch2007-11-21 10:22dancefire
Powered By FusionForge