コード例 #1
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    try
                    {
                        if (_state != TransactionState.NoTransaction)
                        {
                            Rollback();
                        }
                    }
                    catch
                    { }
                    finally
                    {
                        if (disposing)
                        {
                            _db = null;
                            _handle.Dispose();
                            _state        = TransactionState.NoTransaction;
                            _statusVector = null;
                        }

                        _disposed = true;
                        base.Dispose(disposing);
                    }
                }
            }
        }
コード例 #2
0
 protected override void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         try
         {
             if (disposing)
             {
                 Release();
                 Clear();
                 _db              = null;
                 _fields          = null;
                 _parameters      = null;
                 _transaction     = null;
                 _outputParams    = null;
                 _statusVector    = null;
                 _allRowsFetched  = false;
                 _state           = StatementState.Deallocated;
                 _statementType   = DbStatementType.None;
                 _recordsAffected = 0;
                 _handle.Dispose();
                 FetchSize = 0;
             }
         }
         finally
         {
             _disposed = true;
             base.Dispose(disposing);
         }
     }
 }
コード例 #3
0
        private void Dispose(bool disposing)
        {
            lock (this)
            {
                if (!this.disposed)
                {
                    try
                    {
                        // release any unmanaged resources
                        this.Rollback();
                    }
                    catch
                    {
                    }
                    finally
                    {
                        // release any managed resources
                        if (disposing)
                        {
                            this.db           = null;
                            this.handle       = 0;
                            this.state        = TransactionState.NoTransaction;
                            this.statusVector = null;
                        }

                        this.disposed = true;
                    }
                }
            }
        }
コード例 #4
0
		public FesTransaction(IDatabase db)
		{
			if (!(db is FesDatabase))
			{
				throw new ArgumentException("Specified argument is not of FesDatabase type.");
			}

			_db = (FesDatabase)db;
			_state = TransactionState.NoTransaction;
			_statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
		}
コード例 #5
0
        public FesTransaction(IDatabase db)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException($"Specified argument is not of {nameof(FesDatabase)} type.");
            }

            _db           = (FesDatabase)db;
            _handle       = new TransactionHandle();
            _state        = TransactionState.NoTransaction;
            _statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
        }
コード例 #6
0
        public FesTransaction(IDatabase db)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }

            this.db           = (FesDatabase)db;
            this.state        = TransactionState.NoTransaction;
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];

            GC.SuppressFinalize(this);
        }
コード例 #7
0
        public FesTransaction(IDatabase db)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }

            this.db = (FesDatabase)db;
            this.state = TransactionState.NoTransaction;
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];

            GC.SuppressFinalize(this);
        }
コード例 #8
0
 public FesArray(DatabaseBase db, TransactionBase transaction, long handle, string tableName, string fieldName)
     : base(tableName, fieldName)
 {
     if (!(db is FesDatabase))
     {
         throw new ArgumentException($"Specified argument is not of {nameof(FesDatabase)} type.");
     }
     if (!(transaction is FesTransaction))
     {
         throw new ArgumentException($"Specified argument is not of {nameof(FesTransaction)} type.");
     }
     _db           = (FesDatabase)db;
     _transaction  = (FesTransaction)transaction;
     _handle       = handle;
     _statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
 }
コード例 #9
0
 public override async ValueTask Dispose2Async(CancellationToken cancellationToken = default)
 {
     if (!_disposed)
     {
         _disposed = true;
         if (State != TransactionState.NoTransaction)
         {
             await RollbackAsync(cancellationToken).ConfigureAwait(false);
         }
         _db = null;
         _handle.Dispose();
         State         = TransactionState.NoTransaction;
         _statusVector = null;
         await base.Dispose2Async(cancellationToken).ConfigureAwait(false);
     }
 }
コード例 #10
0
 public override async Task Dispose2(AsyncWrappingCommonArgs async)
 {
     if (!_disposed)
     {
         _disposed = true;
         if (State != TransactionState.NoTransaction)
         {
             await Rollback(async).ConfigureAwait(false);
         }
         _db = null;
         _handle.Dispose();
         State         = TransactionState.NoTransaction;
         _statusVector = null;
         await base.Dispose2(async).ConfigureAwait(false);
     }
 }
コード例 #11
0
 public override void Dispose()
 {
     if (!_disposed)
     {
         _disposed = true;
         if (_state != TransactionState.NoTransaction)
         {
             Rollback();
         }
         _db = null;
         _handle.Dispose();
         _state        = TransactionState.NoTransaction;
         _statusVector = null;
         base.Dispose();
     }
 }
コード例 #12
0
        public FesStatement(DatabaseBase db, TransactionBase transaction)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException($"Specified argument is not of {nameof(FesDatabase)} type.");
            }

            _db              = (FesDatabase)db;
            _handle          = new StatementHandle();
            OutputParameters = new Queue <DbValue[]>();
            _statusVector    = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
            _fetchSqlDa      = IntPtr.Zero;

            if (transaction != null)
            {
                Transaction = transaction;
            }
        }
コード例 #13
0
 public override void Dispose2()
 {
     if (!_disposed)
     {
         _disposed = true;
         Release();
         Clear();
         _db              = null;
         _fields          = null;
         _parameters      = null;
         _transaction     = null;
         OutputParameters = null;
         _statusVector    = null;
         _allRowsFetched  = false;
         _handle.Dispose();
         FetchSize = 0;
         base.Dispose2();
     }
 }
コード例 #14
0
		public FesBlob(IDatabase db, ITransaction transaction, long blobId)
			: base(db)
		{
			if (!(db is FesDatabase))
			{
				throw new ArgumentException("Specified argument is not of FesDatabase type.");
			}
			if (!(transaction is FesTransaction))
			{
				throw new ArgumentException("Specified argument is not of FesTransaction type.");
			}

			_db = (FesDatabase)db;
			_transaction = (FesTransaction)transaction;
			_position = 0;
			_blobHandle = 0;
			_blobId = blobId;
			_statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
		}
コード例 #15
0
        public FesBlob(IDatabase db, ITransaction transaction, long blobId)
            : base(db)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }
            if (!(transaction is FesTransaction))
            {
                throw new ArgumentException("Specified argument is not of FesTransaction type.");
            }

            this.db           = (FesDatabase)db;
            this.transaction  = (FesTransaction)transaction;
            this.position     = 0;
            this.blobHandle   = 0;
            this.blobId       = blobId;
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
        }
コード例 #16
0
        public FesStatement(IDatabase db, TransactionBase transaction)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }

            _recordsAffected = -1;
            _db           = (FesDatabase)db;
            _handle       = new StatementHandle();
            _outputParams = new Queue();
            _statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
            _fetchSqlDa   = IntPtr.Zero;

            if (transaction != null)
            {
                Transaction = transaction;
            }
        }
コード例 #17
0
        public FesBlob(IDatabase db, TransactionBase transaction, long blobId)
            : base(db)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException($"Specified argument is not of {nameof(FesDatabase)} type.");
            }
            if (!(transaction is FesTransaction))
            {
                throw new ArgumentException($"Specified argument is not of {nameof(FesTransaction)} type.");
            }

            _db           = (FesDatabase)db;
            _transaction  = (FesTransaction)transaction;
            _position     = 0;
            _blobHandle   = new BlobHandle();
            _blobId       = blobId;
            _statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
        }
コード例 #18
0
        public void Attach(ServiceParameterBuffer spb, string dataSource, int port, string service, byte[] cryptKey)
        {
            FesDatabase.CheckCryptKeyForSupport(cryptKey);

            ClearStatusVector();

            var svcHandle = Handle;

            _fbClient.isc_service_attach(
                _statusVector,
                (short)service.Length,
                service,
                ref svcHandle,
                spb.Length,
                spb.ToArray());

            ProcessStatusVector(_statusVector);

            _handle = svcHandle;
        }
コード例 #19
0
        public override async Task Dispose2(AsyncWrappingCommonArgs async)
        {
            if (!_disposed)
            {
                _disposed = true;
                await Release(async).ConfigureAwait(false);

                Clear();
                _db              = null;
                _fields          = null;
                _parameters      = null;
                _transaction     = null;
                OutputParameters = null;
                _statusVector    = null;
                _allRowsFetched  = false;
                _handle.Dispose();
                FetchSize = 0;
                await base.Dispose2(async).ConfigureAwait(false);
            }
        }
コード例 #20
0
        public FesStatement(IDatabase db, ITransaction transaction)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }

            this.recordsAffected = -1;
            this.db           = (FesDatabase)db;
            this.outputParams = new Queue();
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
            this.fetchSqlDa   = IntPtr.Zero;

            if (transaction != null)
            {
                this.Transaction = transaction;
            }

            GC.SuppressFinalize(this);
        }
コード例 #21
0
ファイル: FesStatement.cs プロジェクト: kingpong/NETProvider
        public FesStatement(IDatabase db, ITransaction transaction)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of FesDatabase type.");
            }

            this.recordsAffected = -1;
            this.db = (FesDatabase)db;
            this.outputParams = new Queue();
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
            this.fetchSqlDa = IntPtr.Zero;

            if (transaction != null)
            {
                this.Transaction = transaction;
            }

            GC.SuppressFinalize(this);
        }
コード例 #22
0
        public override async ValueTask Dispose2Async(CancellationToken cancellationToken = default)
        {
            if (!_disposed)
            {
                _disposed = true;
                await ReleaseAsync(cancellationToken).ConfigureAwait(false);

                Clear();
                _db              = null;
                _fields          = null;
                _parameters      = null;
                _transaction     = null;
                OutputParameters = null;
                _statusVector    = null;
                _allRowsFetched  = false;
                _handle.Dispose();
                FetchSize = 0;
                await base.Dispose2Async(cancellationToken).ConfigureAwait(false);
            }
        }
コード例 #23
0
        public override ValueTask AttachAsync(ServiceParameterBufferBase spb, string dataSource, int port, string service, byte[] cryptKey, CancellationToken cancellationToken = default)
        {
            FesDatabase.CheckCryptKeyForSupport(cryptKey);

            ClearStatusVector();

            var svcHandle = Handle;

            _fbClient.isc_service_attach(
                _statusVector,
                (short)service.Length,
                service,
                ref svcHandle,
                spb.Length,
                spb.ToArray());

            ProcessStatusVector(_statusVector);

            Handle = svcHandle;

            return(ValueTask2.CompletedTask);
        }
コード例 #24
0
        public override Task Attach(ServiceParameterBuffer spb, string dataSource, int port, string service, byte[] cryptKey, AsyncWrappingCommonArgs async)
        {
            FesDatabase.CheckCryptKeyForSupport(cryptKey);

            ClearStatusVector();

            var svcHandle = Handle;

            _fbClient.isc_service_attach(
                _statusVector,
                (short)service.Length,
                service,
                ref svcHandle,
                spb.Length,
                spb.ToArray());

            ProcessStatusVector(_statusVector);

            Handle = svcHandle;

            return(Task.CompletedTask);
        }
コード例 #25
0
ファイル: FesArray.cs プロジェクト: kingpong/NETProvider
        public FesArray(
            IDatabase db,
            ITransaction transaction,
            long handle,
            string tableName,
            string fieldName)
            : base(tableName, fieldName)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }
            if (!(transaction is FesTransaction))
            {
                throw new ArgumentException("Specified argument is not of GdsTransaction type.");
            }
            this.db = (FesDatabase)db;
            this.transaction = (FesTransaction)transaction;
            this.handle = handle;
            this.statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];

            this.LookupBounds();
        }
コード例 #26
0
        public FesArray(
            IDatabase db,
            ITransaction transaction,
            long handle,
            string tableName,
            string fieldName)
            : base(tableName, fieldName)
        {
            if (!(db is FesDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }
            if (!(transaction is FesTransaction))
            {
                throw new ArgumentException("Specified argument is not of GdsTransaction type.");
            }
            _db           = (FesDatabase)db;
            _transaction  = (FesTransaction)transaction;
            _handle       = handle;
            _statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];

            LookupBounds();
        }
コード例 #27
0
        protected override void Dispose(bool disposing)
        {
            if (!IsDisposed)
            {
                try
                {
                    // release any unmanaged resources
                    Release();
                }
                catch
                {
                }
                finally
                {
                    // release any managed resources
                    if (disposing)
                    {
                        Clear();

                        _db              = null;
                        _fields          = null;
                        _parameters      = null;
                        _transaction     = null;
                        _outputParams    = null;
                        _statusVector    = null;
                        _allRowsFetched  = false;
                        _state           = StatementState.Deallocated;
                        _statementType   = DbStatementType.None;
                        _recordsAffected = 0;
                        _handle          = 0;
                        FetchSize        = 0;
                    }

                    base.Dispose(disposing);
                }
            }
        }
コード例 #28
0
        protected override void Dispose(bool disposing)
        {
            if (!this.IsDisposed)
            {
                try
                {
                    // release any unmanaged resources
                    this.Release();
                }
                catch
                {
                }
                finally
                {
                    // release any managed resources
                    if (disposing)
                    {
                        this.Clear();

                        this.db              = null;
                        this.fields          = null;
                        this.parameters      = null;
                        this.transaction     = null;
                        this.outputParams    = null;
                        this.statusVector    = null;
                        this.allRowsFetched  = false;
                        this.state           = StatementState.Deallocated;
                        this.statementType   = DbStatementType.None;
                        this.recordsAffected = 0;
                        this.handle          = 0;
                        this.FetchSize       = 0;
                    }

                    base.Dispose(disposing);
                }
            }
        }
コード例 #29
0
        protected override void Dispose(bool disposing)
        {
            if (!this.IsDisposed)
            {
                try
                {
                    // release any unmanaged resources
                    this.Release();
                }
                catch
                {
                }
                finally
                {
                    // release any managed resources
                    if (disposing)
                    {
                        this.Clear();

                        this.db = null;
                        this.fields = null;
                        this.parameters = null;
                        this.transaction = null;
                        this.outputParams = null;
                        this.statusVector = null;
                        this.allRowsFetched = false;
                        this.state = StatementState.Deallocated;
                        this.statementType = DbStatementType.None;
                        this.recordsAffected = 0;
                        this.handle = 0;
                        this.FetchSize = 0;
                    }

                    base.Dispose(disposing);
                }
            }
        }
コード例 #30
0
		public FesStatement(IDatabase db, ITransaction transaction)
		{
			if (!(db is FesDatabase))
			{
				throw new ArgumentException("Specified argument is not of FesDatabase type.");
			}

			_recordsAffected = -1;
			_db = (FesDatabase)db;
			_outputParams = new Queue();
			_statusVector = new IntPtr[IscCodes.ISC_STATUS_LENGTH];
			_fetchSqlDa = IntPtr.Zero;

			if (transaction != null)
			{
				Transaction = transaction;
			}
		}
コード例 #31
0
        private void Dispose(bool disposing)
        {
            lock (this)
            {
                if (!this.disposed)
                {
                    try
                    {
                        // release any unmanaged resources
                        this.Rollback();
                    }
                    catch
                    {
                    }
                    finally
                    {
                        // release any managed resources
                        if (disposing)
                        {
                            this.db = null;
                            this.handle = 0;
                            this.state = TransactionState.NoTransaction;
                            this.statusVector = null;
                        }

                        this.disposed = true;
                    }
                }
            }
        }
コード例 #32
0
		private void Dispose(bool disposing)
		{
			lock (this)
			{
				if (!_disposed)
				{
					try
					{
						Rollback();
					}
					catch
					{ }
					finally
					{
						if (disposing)
						{
							_db = null;
							_handle = 0;
							_state = TransactionState.NoTransaction;
							_statusVector = null;
						}

						_disposed = true;
					}
				}
			}
		}
コード例 #33
0
		protected override void Dispose(bool disposing)
		{
			if (!IsDisposed)
			{
				try
				{
					Release();
				}
				catch
				{ }
				finally
				{
					if (disposing)
					{
						Clear();

						_db = null;
						_fields = null;
						_parameters = null;
						_transaction = null;
						_outputParams = null;
						_statusVector = null;
						_allRowsFetched = false;
						_state = StatementState.Deallocated;
						_statementType = DbStatementType.None;
						_recordsAffected = 0;
						_handle = 0;
						FetchSize = 0;
					}

					base.Dispose(disposing);
				}
			}
		}