Ejemplo n.º 1
0
 internal MQRecoveryEnlistment(ManagedHconn manHconn, NmqiEnvironment env, sbyte[] xid, int rmid) : base(env)
 {
     this.recoveryXid    = new MQXid();
     this.xidList        = new MQXid[XIDLIST_COUNT];
     this.incompleteXids = new ArrayList();
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { manHconn, env, xid, rmid });
     this.recoveryHconn = manHconn;
     this.xid_          = new byte[xid.Length];
     Buffer.BlockCopy(xid, 0, this.xid_, 0, this.xid_.Length);
     this.recoveryXid.ReadXidFromBytes(this.xid_, 0);
     this.rmid_ = rmid;
     this.CheckXidListedIncompleteInWMQ();
 }
Ejemplo n.º 2
0
        internal void LogCurrentTransactionStart(byte[] xidBytes, MQXid xid, Guid queueManagerUid, int rmid, byte[] recinfo)
        {
            uint method = 0x52b;

            this.TrEntry(method, new object[] { xidBytes, queueManagerUid, rmid, recinfo });
            try
            {
                MQMessage mqMsg = new MQMessage();
                mqMsg.Persistence = 1;
                int     compCode = 0;
                int     reason   = 0;
                sbyte[] dst      = new sbyte[queueManagerUid.ToByteArray().Length];
                Buffer.BlockCopy(queueManagerUid.ToByteArray(), 0, dst, 0, dst.Length);
                base.TrText(method, "Qmid=" + NmqiTools.ArrayToHexString(queueManagerUid.ToByteArray()));
                sbyte[] numArray2 = new sbyte[recinfo.Length];
                Buffer.BlockCopy(recinfo, 0, numArray2, 0, numArray2.Length);
                base.TrText(method, "recordinfo=" + NmqiTools.ArrayToHexString(recinfo));
                sbyte[] numArray3 = new sbyte[xidBytes.Length];
                Buffer.BlockCopy(xidBytes, 0, numArray3, 0, numArray3.Length);
                base.TrText(method, "recordinfo=" + NmqiTools.ArrayToHexString(xidBytes));
                mqMsg.SetBytesProperty("dnet.XARECOVERY_QMID", dst);
                mqMsg.SetBytesProperty("dnet.XARECOVERY_RECINFO", numArray2);
                mqMsg.SetBytesProperty("dnet.XARECOVERY_XID", numArray3);
                mqMsg.SetIntProperty("dnet.XARECOVERY_RMID", rmid);
                mqMsg.SetDoubleProperty("dnet.XARECOVERY_TTIMEOUT", TransactionManager.MaximumTimeout.TotalMilliseconds);
                mqMsg.SetStringProperty("dnet.XARECOVERY_HOSTANDUSER", this.hostAndUser);
                this.marshal = new MQMarshalMessageForPut(mqMsg);
                mqMsg        = this.marshal.ConstructMessageForSend();
                byte[] sBuff           = mqMsg.GetBuffer();
                MQMessageDescriptor md = mqMsg.md;
                this.recoveryHconn.Session.MQFap.MQPUT(this.recoveryHconn, this.recoveryHobj.HOBJ, ref md, ref this.recoveryPutPmo, sBuff.Length, sBuff, null, 1, out compCode, out reason);
                base.TrText(method, "MessageId-" + NmqiTools.ArrayToHexString(md.MsgId));
                if (compCode != 0)
                {
                    base.throwNewMQException(compCode, reason);
                }
                this.TransactionLogList.Add(xid, mqMsg.md);
                this.marshal.Dispose(false);
                this.marshal = null;
                mqMsg        = null;
                sBuff        = null;
            }
            finally
            {
                base.TrExit(method);
            }
        }
        public void InitializeMQRMI()
        {
            uint method = 0x50b;

            this.TrEntry(method);
            try
            {
                this.xid   = new MQXid();
                this.gtrid = this.myGuid;
                this.btrid = this.GetBranchQualifier();
                this.xid.SetXid(this.gtrid, this.btrid);
                this.xid.TraceFields();
                this.MQRMIXAStart();
            }
            finally
            {
                base.TrExit(method);
            }
        }
Ejemplo n.º 4
0
        internal void LogCurrentTransactionEnd(MQXid xid, int rmid)
        {
            uint method = 0x52c;

            this.TrEntry(method, new object[] { xid, rmid });
            MQMessageDescriptor msgDesc = new MQMessageDescriptor();

            msgDesc.Version = 2;
            try
            {
                if (this.TransactionLogList.ContainsKey(xid))
                {
                    MQMessageDescriptor descriptor2 = (MQMessageDescriptor)this.TransactionLogList[xid];
                    msgDesc.MsgId = descriptor2.MsgId;
                    base.TrText(method, "MessageId-" + NmqiTools.ArrayToHexString(msgDesc.MsgId));
                    int          dataLength   = 0;
                    int          bufferLength = 0x1000;
                    byte[]       buffer       = new byte[bufferLength];
                    int          compCode     = 0;
                    int          reason       = 0;
                    MQProxyQueue proxyQueue   = ((ManagedHobj)this.recoveryHobj.HOBJ).ProxyQueue;
                    if (proxyQueue != null)
                    {
                        proxyQueue.ProxyMQGET(msgDesc, this.recoveryGetGmo, bufferLength, buffer, ref dataLength, null, ref compCode, ref reason);
                    }
                    else
                    {
                        this.recoveryHconn.GetMQFAP.MQGET(this.recoveryHconn, this.recoveryHobj.HOBJ, msgDesc, this.recoveryGetGmo, bufferLength, buffer, out dataLength, out compCode, out reason);
                    }
                    if (compCode != 0)
                    {
                        base.throwNewMQException(compCode, reason);
                    }
                    this.TransactionLogList.Remove(xid);
                    buffer = null;
                }
            }
            finally
            {
                base.TrExit(method);
            }
        }