Exemplo n.º 1
0
        /// <summary>
        /// Don't call any of the above when this one is called
        /// </summary>
        internal static void close(SqlFsLocker locker)
        {
            lock (typeof(SqlFsLocker))
            {
                if (lockerTable == null)
                {
                    return;
                }

                string tableKey = locker.TableKey;
                int?   count    = refCountTable[tableKey];
                if (count == null)
                {
                    return;
                }

                int newCount = (int)count - 1;
                if (newCount == 0)
                {
                    // remove all references
                    lockerTable.Remove(tableKey);
                    refCountTable.Remove(tableKey);
                    locker.close();
                }
                else
                {
                    // decrease reference count by 1
                    refCountTable[tableKey] = newCount;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///  Should close the DB after use.
        /// </summary>
        public virtual void close()
        {
            SqlFsErrCode.unset();

            SqlFsLocker.close(fsLocker);
            fsLocker = null;

            if (this.db != null)
            {
                this.db.close();
                this.db = null;
            }
        }