/// <summary> /// Write query arguments. /// </summary> /// <param name="writer">Writer.</param> /// <param name="args">Arguments.</param> internal static void WriteQueryArgs(IBinaryRawWriter writer, object[] args) { if (args == null) { writer.WriteInt(0); } else { writer.WriteInt(args.Length); foreach (var arg in args) { // Write DateTime as TimeStamp always, otherwise it does not make sense // Wrapped DateTime comparison does not work in SQL var dt = arg as DateTime?; // Works with DateTime also if (dt != null) { writer.WriteTimestamp(dt); } else { writer.WriteObject(arg); } } } }
/// <summary> /// Writes this object to the given writer. /// </summary> public void WriteBinary(IBinaryRawWriter writer, bool changesOnly) { ((IgniteSessionStateItemCollection)Items).WriteBinary(writer, changesOnly); writer.WriteByteArray(SerializeStaticObjects()); writer.WriteInt(Timeout); writer.WriteGuid(LockNodeId); writer.WriteLong(LockId); writer.WriteTimestamp(LockTime); }
/// <summary> /// Writes the lock info. /// </summary> private void WriteLockInfo(IBinaryRawWriter writer, long lockId, bool writeTime = false) { writer.WriteGuid(Cache.Ignite.GetCluster().GetLocalNode().Id); writer.WriteLong(lockId); if (writeTime) { writer.WriteTimestamp(DateTime.UtcNow); } }
/// <summary> /// Writes this object to the given writer. /// </summary> public void WriteBinary(IBinaryRawWriter writer, bool changesOnly) { ((IgniteSessionStateItemCollection)Items).WriteBinary(writer, changesOnly); writer.WriteByteArray(SerializeStaticObjects()); writer.WriteInt(Timeout); writer.WriteGuid(LockNodeId); writer.WriteLong(LockId); writer.WriteTimestamp(LockTime); }