コード例 #1
0
 public NativeSessionHandle StartSession(NativeSessionInfo sessionInfo)
 {
     try
     {
         return(_nativeServer.StartSession(sessionInfo));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
コード例 #2
0
 public NativeResult[] ExecuteStatements(NativeSessionInfo sessionInfo, NativeExecuteOperation[] operations)
 {
     try
     {
         return(_nativeServer.Execute(sessionInfo, operations));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
コード例 #3
0
 public NativeResult ExecuteStatement(NativeSessionInfo sessionInfo, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         return(_nativeServer.Execute(sessionInfo, statement, paramsValue, options));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
コード例 #4
0
 public NativeResult[] Execute(NativeSessionInfo sessionInfo, NativeExecuteOperation[] operations)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginExecuteStatements(sessionInfo, operations, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndExecuteStatements(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
コード例 #5
0
 public NativeResult Execute(NativeSessionInfo sessionInfo, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginExecuteStatement(sessionInfo, statement, paramsValue, options, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndExecuteStatement(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
コード例 #6
0
 public NativeSessionHandle StartSession(NativeSessionInfo sessionInfo)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginStartSession(sessionInfo, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndStartSession(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
コード例 #7
0
ファイル: NativeServer.cs プロジェクト: laszlo-kiss/Dataphor
        private NativeSession StartNativeSession(NativeSessionInfo sessionInfo)
        {
            NativeSession nativeSession = new NativeSession(sessionInfo);

            nativeSession.Session = _server.Connect(nativeSession.SessionInfo);
            try
            {
                nativeSession.Process = nativeSession.Session.StartProcess(new ProcessInfo(nativeSession.SessionInfo));
                return(nativeSession);
            }
            catch
            {
                StopNativeSession(nativeSession);
                throw;
            }
        }
コード例 #8
0
        public static SessionInfo NativeSessionInfoToSessionInfo(NativeSessionInfo nativeSessionInfo)
        {
            SessionInfo sessionInfo = new SessionInfo();

            sessionInfo.UserID                         = nativeSessionInfo.UserID;
            sessionInfo.Password                       = nativeSessionInfo.Password;
            sessionInfo.DefaultLibraryName             = nativeSessionInfo.DefaultLibraryName;
            sessionInfo.HostName                       = nativeSessionInfo.HostName;
            sessionInfo.Environment                    = "NativeCLI";
            sessionInfo.DefaultUseDTC                  = nativeSessionInfo.DefaultUseDTC;
            sessionInfo.DefaultIsolationLevel          = NativeIsolationLevelToIsolationLevel(nativeSessionInfo.DefaultIsolationLevel);
            sessionInfo.DefaultUseImplicitTransactions = nativeSessionInfo.DefaultUseImplicitTransactions;
            sessionInfo.DefaultMaxStackDepth           = nativeSessionInfo.DefaultMaxStackDepth;
            sessionInfo.DefaultMaxCallDepth            = nativeSessionInfo.DefaultMaxCallDepth;
            sessionInfo.UsePlanCache                   = nativeSessionInfo.UsePlanCache;
            sessionInfo.ShouldEmitIL                   = nativeSessionInfo.ShouldEmitIL;
            return(sessionInfo);
        }
コード例 #9
0
ファイル: NativeServer.cs プロジェクト: laszlo-kiss/Dataphor
 public NativeResult[] Execute(NativeSessionInfo sessionInfo, NativeExecuteOperation[] operations)
 {
     try
     {
         NativeSession nativeSession = StartNativeSession(sessionInfo);
         try
         {
             return(nativeSession.Execute(operations));
         }
         finally
         {
             StopNativeSession(nativeSession);
         }
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
コード例 #10
0
ファイル: NativeServer.cs プロジェクト: laszlo-kiss/Dataphor
 public NativeResult Execute(NativeSessionInfo sessionInfo, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         NativeSession nativeSession = StartNativeSession(sessionInfo);
         try
         {
             return(nativeSession.Execute(statement, paramsValue, options));
         }
         finally
         {
             StopNativeSession(nativeSession);
         }
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
コード例 #11
0
ファイル: NativeServer.cs プロジェクト: laszlo-kiss/Dataphor
 public NativeSessionHandle StartSession(NativeSessionInfo sessionInfo)
 {
     try
     {
         NativeSession nativeSession = StartNativeSession(sessionInfo);
         try
         {
             return(AddNativeSession(nativeSession));
         }
         catch
         {
             StopNativeSession(nativeSession);
             throw;
         }
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
コード例 #12
0
ファイル: NativeSession.cs プロジェクト: laszlo-kiss/Dataphor
 public NativeSession(NativeSessionInfo nativeSessionInfo)
 {
     _iD = Guid.NewGuid();
     _nativeSessionInfo = nativeSessionInfo;
 }
コード例 #13
0
 public NativeCLISession(string hostName, string instanceName, int overridePortNumber, ConnectionSecurityMode securityMode, int overrideListenerPortNumber, ConnectionSecurityMode listenerSecurityMode, NativeSessionInfo nativeSessionInfo)
 {
     _nativeCLI         = new NativeSessionCLIClient(hostName, instanceName, overridePortNumber, securityMode, overrideListenerPortNumber, listenerSecurityMode);
     _nativeSessionInfo = nativeSessionInfo;
     _sessionHandle     = _nativeCLI.StartSession(nativeSessionInfo);
 }