コード例 #1
0
 /// <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;
 }
コード例 #2
0
        /// <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);
        }
コード例 #3
0
ファイル: ConnectionPoolTest.cs プロジェクト: marcsommer/mdo
 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 = "******",
         },
     };
 }
コード例 #4
0
ファイル: ConnectionPoolTest.cs プロジェクト: kunalkot/mdo
 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 = "******",
         },
     };
 }