public GdsTransaction(IDatabase db)
		{
			if (!(db is GdsDatabase))
			{
				throw new ArgumentException("Specified argument is not of GdsDatabase type.");
			}

			this.db		= (GdsDatabase)db;
			this.state	= TransactionState.NoTransaction;

			GC.SuppressFinalize(this);
		}
Exemple #2
0
        public GdsTransaction(IDatabase db)
        {
            if (!(db is GdsDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }

            this.db    = (GdsDatabase)db;
            this.state = TransactionState.NoTransaction;

            GC.SuppressFinalize(this);
        }
		public GdsBlob(IDatabase db, ITransaction transaction, long blobId) : base(db)
		{
			if (!(db is GdsDatabase))
			{
				throw new ArgumentException("Specified argument is not of GdsDatabase type.");
			}
			if (!(transaction is GdsTransaction))
			{
				throw new ArgumentException("Specified argument is not of GdsTransaction type.");
			}

			this.db				= (GdsDatabase)db;
			this.transaction	= transaction;
			this.position		= 0;
			this.blobHandle		= 0;
			this.blobId			= blobId;
		}
Exemple #4
0
        public GdsBlob(IDatabase db, ITransaction transaction, long blobId) : base(db)
        {
            if (!(db is GdsDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }
            if (!(transaction is GdsTransaction))
            {
                throw new ArgumentException("Specified argument is not of GdsTransaction type.");
            }

            this.db          = (GdsDatabase)db;
            this.transaction = transaction;
            this.position    = 0;
            this.blobHandle  = 0;
            this.blobId      = blobId;
        }
Exemple #5
0
        public GdsArray(IDatabase db, ITransaction transaction, long handle, string tableName, string fieldName)
            : base(tableName, fieldName)
        {
            if (!(db is GdsDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }

            if (!(transaction is GdsTransaction))
            {
                throw new ArgumentException("Specified argument is not of GdsTransaction type.");
            }

            this.db          = (GdsDatabase)db;
            this.transaction = (GdsTransaction)transaction;
            this.handle      = handle;

            this.LookupBounds();
        }
		public GdsArray(IDatabase db, ITransaction transaction, long handle, string tableName, string fieldName)
			: base(tableName, fieldName)
		{
			if (!(db is GdsDatabase))
			{
				throw new ArgumentException("Specified argument is not of GdsDatabase type.");
			}

			if (!(transaction is GdsTransaction))
			{
				throw new ArgumentException("Specified argument is not of GdsTransaction type.");
			}

			this.db				= (GdsDatabase)db;
			this.transaction	= (GdsTransaction)transaction;
			this.handle			= handle;

			this.LookupBounds();
		}
Exemple #7
0
        protected override void Dispose(bool disposing)
        {
            lock (this)
            {
                if (!this.IsDisposed)
                {
                    try
                    {
                        // release any unmanaged resources
                        this.Release();

                        // release any managed resources
                        if (disposing)
                        {
                            this.Clear();

                            this.rows            = null;
                            this.outputParams    = null;
                            this.db              = null;
                            this.fields          = null;
                            this.parameters      = null;
                            this.transaction     = null;
                            this.allRowsFetched  = false;
                            this.state           = StatementState.Deallocated;
                            this.handle          = 0;
                            this.fetchSize       = 0;
                            this.recordsAffected = 0;
                        }
                    }
                    finally
                    {
                        base.Dispose(disposing);
                    }
                }
            }
        }
Exemple #8
0
        public GdsStatement(IDatabase db, ITransaction transaction)
        {
            if (!(db is GdsDatabase))
            {
                throw new ArgumentException("Specified argument is not of GdsDatabase type.");
            }
            if (transaction != null && !(transaction is GdsTransaction))
            {
                throw new ArgumentException("Specified argument is not of GdsTransaction type.");
            }

            this.recordsAffected = -1;
            this.fetchSize       = 200;
            this.rows            = new Queue();
            this.outputParams    = new Queue();

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

            GC.SuppressFinalize(this);
        }
		protected override void Dispose(bool disposing)
		{
			lock (this)
			{
				if (!this.IsDisposed)
				{
					try
					{
						// release any unmanaged resources
						this.Release();

						// release any managed resources
						if (disposing)
						{
							this.Clear();

							this.rows			= null;
							this.outputParams	= null;
							this.db				= null;
							this.fields			= null;
							this.parameters		= null;
							this.transaction	= null;
							this.allRowsFetched = false;
							this.state			= StatementState.Deallocated;
							this.handle			= 0;
							this.fetchSize		= 0;
							this.recordsAffected = 0;
						}
					}
					finally
					{
						base.Dispose(disposing);
					}
				}
			}
		}
		public GdsStatement(IDatabase db, ITransaction transaction)
		{
			if (!(db is GdsDatabase))
			{
				throw new ArgumentException("Specified argument is not of GdsDatabase type.");
			}
			if (transaction != null && !(transaction is GdsTransaction))
			{
				throw new ArgumentException("Specified argument is not of GdsTransaction type.");
			}

			this.recordsAffected = -1;
			this.fetchSize		= 200;
			this.rows			= new Queue();
			this.outputParams	= new Queue();

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

			GC.SuppressFinalize(this);
		}
		private void Dispose(bool disposing)
		{
			lock (this)
			{
				if (!this.disposed)
				{
					try
					{
						// release any unmanaged resources
						this.Rollback();

						// release any managed resources
						if (disposing)
						{
							this.db		= null;
							this.handle = 0;
							this.state	= TransactionState.NoTransaction;
						}
					}
					finally
					{
						this.disposed = true;
					}
				}
			}
		}