/// <summary>
        /// Сохранение записей с помощью пула.
        /// </summary>
        public static void WriteRecord
        (
            [NotNull] this IrbisConnectionPool pool,
            [NotNull] IrbisRecord record
        )
        {
            ManagedClient64 client = pool.AcquireConnection();

            client.WriteRecord(record, false, true);
            pool.ReleaseConnection(client);
        }
        public static IrbisRecord ReadRecord
        (
            [NotNull] this IrbisConnectionPool pool,
            int mfn
        )
        {
            ManagedClient64 client = pool.AcquireConnection();
            IrbisRecord     result = client.ReadRecord(mfn);

            pool.ReleaseConnection(client);
            return(result);
        }
        public static int[] Search
        (
            [NotNull] this IrbisConnectionPool pool,
            string format,
            params object[] args
        )
        {
            ManagedClient64 client = pool.AcquireConnection();

            int[] result = client.Search(format, args);
            pool.ReleaseConnection(client);
            return(result);
        }
Esempio n. 4
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        public IrbisPoolGuard
        (
            [NotNull] IrbisConnectionPool pool
        )
        {
            if (pool == null)
            {
                throw new ArgumentNullException("pool");
            }

            Pool       = pool;
            Connection = Pool.AcquireConnection();
        }