Beispiel #1
0
        public int InitialVdbs(
            out string strError)
        {
            strError = "";

            if (this.vdbs != null)
                return 0;   // 优化

            this.m_lock.AcquireWriterLock(m_nLockTimeout);
            try
            {
                XmlNode root = this.OpacCfgDom.DocumentElement.SelectSingleNode(
                    "virtualDatabases");
                if (root == null)
                {
                    strError = "尚未配置<virtualDatabases>元素";
                    return -1;
                }

                this.vdbs = new VirtualDatabaseCollection();
                int nRet = vdbs.Initial(root,
                    out strError);
                if (nRet == -1)
                {
                    this.vdbs = null;   // 2011/2/12
                    return -1;
                }

                return 0;
            }
            finally
            {
                this.m_lock.ReleaseWriterLock();
            }
        }
Beispiel #2
0
        // 初始化虚拟库集合定义对象
        public int InitialVdbs(
            RmsChannelCollection Channels,
            out string strError)
        {
            strError = "";

            if (this.vdbs != null)
                return 0;   // 优化

            // this.m_lock.AcquireWriterLock(m_nLockTimeout);
            this.LockForWrite();    // 2016/10/16
            try
            {
                XmlNode root = this.LibraryCfgDom.DocumentElement.SelectSingleNode(
                    "virtualDatabases");
                if (root == null)
                {
                    strError = "尚未配置<virtualDatabases>元素";
                    return -1;
                }

                XmlNode biblio_dbs_root = this.LibraryCfgDom.DocumentElement.SelectSingleNode(
                    "itemdbgroup");
                /*
                if (root == null)
                {
                    strError = "尚未配置<itemdbgroup>元素";
                    return -1;
                }
                 * */

                this.vdbs = new VirtualDatabaseCollection();
                int nRet = vdbs.Initial(root,
                    Channels,
                    this.WsUrl,
                    biblio_dbs_root,
                    out strError);
                if (nRet == -1)
                {
                    this.vdbs = null;   // 2011/1/29
                    return -1;
                }

                return 0;
            }
            finally
            {
                // this.m_lock.ReleaseWriterLock();
                this.UnlockForWrite();
            }
        }