/// <summary> /// Get a ConnectionPoolSource given a DataSource using the factory's default pool source /// </summary> /// <param name="source">DataSource</param> /// <returns>ConnectionPoolSource</returns> public override AbstractPoolSource getPoolSource(object source) { if (!(source is DataSource)) { throw new ArgumentException("Invalid source. Must supply a DataSource"); } ConnectionPoolSource theSrc = new ConnectionPoolSource(); theSrc.CxnSource = (DataSource)source; if (this.Default is ConnectionPoolSource && null != ((ConnectionPoolSource)this.Default).CxnSource) { theSrc.CxnSource.Protocol = ((ConnectionPoolSource)this.Default).CxnSource.Protocol; // if we set the default pool source's protocol, we should copy it over } theSrc.Credentials = this.Default.Credentials; theSrc.LoadStrategy = this.Default.LoadStrategy; theSrc.MaxPoolSize = this.Default.MaxPoolSize; theSrc.MinPoolSize = this.Default.MinPoolSize; theSrc.PoolExpansionSize = this.Default.PoolExpansionSize; theSrc.WaitTime = this.Default.WaitTime; return theSrc; }
/// <summary> /// Get a ConnectionPoolSource given a DataSource using the factory's default pool source /// </summary> /// <param name="source">DataSource</param> /// <returns>ConnectionPoolSource</returns> public override AbstractPoolSource getPoolSource(object source) { if (!(source is DataSource)) { throw new ArgumentException("Invalid source. Must supply a DataSource"); } ConnectionPoolSource theSrc = new ConnectionPoolSource(); theSrc.CxnSource = (DataSource)source; if (this.Default is ConnectionPoolSource && null != ((ConnectionPoolSource)this.Default).CxnSource) { theSrc.CxnSource.Protocol = ((ConnectionPoolSource)this.Default).CxnSource.Protocol; // if we set the default pool source's protocol, we should copy it over } theSrc.Credentials = this.Default.Credentials; theSrc.LoadStrategy = this.Default.LoadStrategy; theSrc.MaxPoolSize = this.Default.MaxPoolSize; theSrc.MinPoolSize = this.Default.MinPoolSize; theSrc.PoolExpansionSize = this.Default.PoolExpansionSize; theSrc.WaitTime = this.Default.WaitTime; return(theSrc); }
public void testFixtureSetUp() { _localSource = new ConnectionPoolSource() { MaxPoolSize = 8, MinPoolSize = 4, PoolExpansionSize = 1, WaitTime = new TimeSpan(0, 0, 30), Timeout = new TimeSpan(0, 5, 0), CxnSource = new DataSource() { Provider = "127.0.0.1", Port = 9200, Protocol = "PVISTA", // this tells the factory we want a pooled Vista connection - important! Modality = "HIS", SiteId = new SiteId("901", "Local CPM") }, Credentials = new VistaCredentials() { AccountName = "1programmer", AccountPassword = "******", }, }; }