Beispiel #1
0
        public static void DisposePool(string connectionString, IDataset dataset)
        {
            SdeConnectionPool pool = Globals.ConnectionManager[connectionString];

            if (pool == null)
            {
                return;
            }

            pool.Dispose(dataset);
        }
Beispiel #2
0
        /*
         * public SE_STREAM SeStream
         * {
         *  get
         *  {
         *      if (_sdeConnection == null) return new SE_STREAM();
         *      return _sdeConnection.SeStream;
         *  }
         * }
         *
         *
         * public void ResetStream()
         * {
         *  if (_sdeConnection == null) return;
         *
         *  _sdeConnection.ResetStream();
         * }
         * */

        public bool Open(IDataset dataset)
        {
            _errMsg = "";
            _pool   = Globals.ConnectionManager[_connectionString];
            if (_pool == null)
            {
                return(true);
            }
            _sdeConnection = _pool.Alloc(dataset);
            _errMsg        = _pool.LastErrorMessage;

            return(_sdeConnection != null);
        }
        public SdeConnectionPool this[string connectionString]
        {
            get
            {
                lock (_lockThis)
                {
                    foreach (SdeConnectionPool pool in _pools)
                    {
                        if (pool.ConnectionString == connectionString)
                        {
                            return(pool);
                        }
                    }
                    if (_maxPools > 0 && _pools.Count >= _maxPools)
                    {
                        return(null);
                    }

                    SdeConnectionPool newpool = new SdeConnectionPool(_maxConnectionsPerPool, connectionString);
                    _pools.Add(newpool);
                    return(newpool);
                }
            }
        }