Beispiel #1
0
        public void SetResultSetProperties(Result command, Result result)
        {
            int rsProperties = command.RsProperties;
            int props        = result.RsProperties;

            if (rsProperties != props)
            {
                if (ResultProperties.IsReadOnly(rsProperties))
                {
                    props = ResultProperties.AddHoldable(props, ResultProperties.IsHoldable(rsProperties));
                }
                else if (ResultProperties.IsUpdatable(props))
                {
                    if (ResultProperties.IsHoldable(rsProperties))
                    {
                        this._session.AddWarning(Error.GetError(0x1269));
                    }
                }
                else
                {
                    props = ResultProperties.AddHoldable(props, ResultProperties.IsHoldable(rsProperties));
                    this._session.AddWarning(Error.GetError(0x1268));
                }
                if (ResultProperties.IsSensitive(rsProperties))
                {
                    this._session.AddWarning(Error.GetError(0x1267));
                }
                props = ResultProperties.AddScrollable(props, ResultProperties.IsScrollable(rsProperties));
                result.RsProperties = props;
            }
        }
Beispiel #2
0
        public Result GetDataResultHead(Result command, Result result, bool isNetwork)
        {
            int fetchSize = command.GetFetchSize();

            result.SetResultId(this._session.ActionTimestamp);
            int rsProperties = command.RsProperties;
            int props        = result.RsProperties;

            if (rsProperties != props)
            {
                if (ResultProperties.IsReadOnly(rsProperties))
                {
                    props = ResultProperties.AddHoldable(props, ResultProperties.IsHoldable(rsProperties));
                }
                else if (ResultProperties.IsReadOnly(props))
                {
                    props = ResultProperties.AddHoldable(props, ResultProperties.IsHoldable(rsProperties));
                }
                else if (this._session.IsAutoCommit())
                {
                    props = ResultProperties.AddHoldable(props, ResultProperties.IsHoldable(rsProperties));
                }
                else
                {
                    props = ResultProperties.AddHoldable(props, false);
                }
                props = ResultProperties.AddScrollable(props, ResultProperties.IsScrollable(rsProperties));
                result.RsProperties = props;
            }
            bool flag  = false;
            bool flag2 = false;

            if (ResultProperties.IsUpdatable(result.RsProperties) || ResultProperties.IsHoldable(result.RsProperties))
            {
                flag = true;
            }
            if (isNetwork)
            {
                if ((fetchSize != 0) && (result.GetNavigator().GetSize() > fetchSize))
                {
                    flag2 = true;
                    flag  = true;
                }
            }
            else if (!result.GetNavigator().IsMemory())
            {
                flag = true;
            }
            if (flag)
            {
                if (this._resultMap == null)
                {
                    this._resultMap = new Dictionary <long, Result>();
                }
                this._resultMap.Add(result.GetResultId(), result);
            }
            if (flag2)
            {
                result = Result.NewDataHeadResult(this._session, result, 0, fetchSize);
            }
            return(result);
        }