Exemplo n.º 1
0
 private Schema.IRowType GetRowType(RemoteRowHeader header)
 {
     Schema.IRowType rowType = new Schema.RowType();
     for (int index = 0; index < header.Columns.Length; index++)
     {
         rowType.Columns.Add(_serverCursor.SourceRowType.Columns[header.Columns[index]].Copy());
     }
     return(rowType);
 }
Exemplo n.º 2
0
        /// <summary> Returns the requested number of rows from the cursor. </summary>
        /// <param name="header"> A <see cref="RemoteRowHeader"/> structure containing the columns to be returned. </param>
        /// <param name='count'> The number of rows to fetch, with a negative number indicating backwards movement. </param>
        /// <returns> A <see cref="RemoteFetchData"/> structure containing the result of the fetch. </returns>
        public RemoteFetchData Fetch(RemoteRowHeader header, out Guid[] bookmarks, int count, bool skipCurrent, ProcessCallInfo callInfo)
        {
            _plan.Process.ProcessCallInfo(callInfo);

            try
            {
                bookmarks = new Guid[Math.Abs(count)];
                return(InternalFetch(GetRowType(header), bookmarks, count, skipCurrent));
            }
            catch (Exception E)
            {
                throw WrapException(E);
            }
        }
Exemplo n.º 3
0
        private void SourceSelect(IRow row)
        {
            RemoteRowHeader header = new RemoteRowHeader();

            header.Columns = new string[row.DataType.Columns.Count];
            for (int index = 0; index < row.DataType.Columns.Count; index++)
            {
                header.Columns[index] = row.DataType.Columns[index].Name;
            }
            row.ValuesOwned = false;
            byte[] AData = _cursor.Select(header, _plan._process.GetProcessCallInfo()).Data;
            row.AsPhysical = AData;
            _plan._programStatisticsCached = false;
        }
Exemplo n.º 4
0
 public RemoteRowBody Select(RemoteRowHeader header, ProcessCallInfo callInfo)
 {
     try
     {
         var          channel = GetServiceInterface();
         IAsyncResult result  = channel.BeginSelectSpecific(CursorHandle, callInfo, header, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndSelectSpecific(result));
     }
     catch (FaultException <DataphorFault> fault)
     {
         throw DataphorFaultUtility.FaultToException(fault.Detail);
     }
     catch (CommunicationException ce)
     {
         ReportCommunicationError();
         throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce);
     }
 }
Exemplo n.º 5
0
 public RemoteFetchData Fetch(RemoteRowHeader header, out Guid[] bookmarks, int count, bool skipCurrent, ProcessCallInfo callInfo)
 {
     try
     {
         var          channel = GetServiceInterface();
         IAsyncResult result  = channel.BeginFetchSpecific(CursorHandle, callInfo, header, count, skipCurrent, null, null);
         result.AsyncWaitHandle.WaitOne();
         FetchResult fetchResult = channel.EndFetchSpecific(result);
         bookmarks = fetchResult.Bookmarks;
         return(fetchResult.FetchData);
     }
     catch (FaultException <DataphorFault> fault)
     {
         throw DataphorFaultUtility.FaultToException(fault.Detail);
     }
     catch (CommunicationException ce)
     {
         ReportCommunicationError();
         throw new ServerException(ServerException.Codes.CommunicationFailure, ErrorSeverity.Environment, ce);
     }
 }
Exemplo n.º 6
0
 // IRemoteServerCursor
 /// <summary> Returns the current row of the cursor. </summary>
 /// <param name="header"> A <see cref="RemoteRowHeader"/> structure containing the columns to be returned. </param>
 /// <returns> A <see cref="RemoteRowBody"/> structure containing the row information. </returns>
 public RemoteRowBody Select(RemoteRowHeader header, ProcessCallInfo callInfo)
 {
     _plan.Process.ProcessCallInfo(callInfo);
     try
     {
         Row row = new Row(_plan.Process.ServerProcess.ValueManager, GetRowType(header));
         try
         {
             row.ValuesOwned = false;
             _serverCursor.Select(row);
             RemoteRowBody body = new RemoteRowBody();
             body.Data = row.AsPhysical;
             return(body);
         }
         finally
         {
             row.Dispose();
         }
     }
     catch (Exception E)
     {
         throw WrapException(E);
     }
 }