Пример #1
0
 public void Dispose()
 {
     if (_sessionHandle != null)
     {
         _nativeCLI.StopSession(_sessionHandle);
         _sessionHandle = null;
     }
 }
Пример #2
0
 public NativeResult[] Execute(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations)
 {
     try
     {
         return(GetNativeSession(sessionHandle).Execute(operations));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #3
0
 public NativeResult Execute(NativeSessionHandle sessionHandle, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         return(GetNativeSession(sessionHandle).Execute(statement, paramsValue, options));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #4
0
 public int GetTransactionCount(NativeSessionHandle sessionHandle)
 {
     try
     {
         return(GetNativeSession(sessionHandle).Process.TransactionCount);
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #5
0
 public int GetTransactionCount(NativeSessionHandle sessionHandle)
 {
     try
     {
         return(_nativeServer.GetTransactionCount(sessionHandle));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
Пример #6
0
 public void BeginTransaction(NativeSessionHandle sessionHandle, NativeIsolationLevel isolationLevel)
 {
     try
     {
         GetNativeSession(sessionHandle).Process.BeginTransaction(NativeCLIUtility.NativeIsolationLevelToIsolationLevel(isolationLevel));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #7
0
 public void StopSession(NativeSessionHandle sessionHandle)
 {
     try
     {
         StopNativeSession(RemoveNativeSession(sessionHandle));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #8
0
 public void RollbackTransaction(NativeSessionHandle sessionHandle)
 {
     try
     {
         _nativeServer.RollbackTransaction(sessionHandle);
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
Пример #9
0
 public void BeginTransaction(NativeSessionHandle sessionHandle, NativeIsolationLevel isolationLevel)
 {
     try
     {
         _nativeServer.BeginTransaction(sessionHandle, isolationLevel);
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
Пример #10
0
 public NativeResult[] SessionExecuteStatements(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations)
 {
     try
     {
         return(_nativeServer.Execute(sessionHandle, operations));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
Пример #11
0
 public NativeResult SessionExecuteStatement(NativeSessionHandle sessionHandle, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         return(_nativeServer.Execute(sessionHandle, statement, paramsValue, options));
     }
     catch (NativeCLIException exception)
     {
         throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message);
     }
 }
Пример #12
0
        private NativeSession GetNativeSession(NativeSessionHandle sessionHandle)
        {
            NativeSession nativeSession;

            if (_nativeSessions.TryGetValue(sessionHandle.ID, out nativeSession))
            {
                return(nativeSession);
            }

            throw new ArgumentException(String.Format("Invalid session handle: \"{0}\".", sessionHandle.ID.ToString()));
        }
Пример #13
0
 public void RollbackTransaction(NativeSessionHandle sessionHandle)
 {
     try
     {
         GetNativeSession(sessionHandle).Process.RollbackTransaction();
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Пример #14
0
 public NativeResult[] Execute(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginSessionExecuteStatements(sessionHandle, operations, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndSessionExecuteStatements(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
Пример #15
0
 public int GetTransactionCount(NativeSessionHandle sessionHandle)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginGetTransactionCount(sessionHandle, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndGetTransactionCount(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
Пример #16
0
 public NativeResult Execute(NativeSessionHandle sessionHandle, string statement, NativeParam[] paramsValue, NativeExecutionOptions options)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginSessionExecuteStatement(sessionHandle, statement, paramsValue, options, null, null);
         result.AsyncWaitHandle.WaitOne();
         return(channel.EndSessionExecuteStatement(result));
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }
Пример #17
0
 public void RollbackTransaction(NativeSessionHandle sessionHandle)
 {
     try
     {
         var          channel = GetInterface();
         IAsyncResult result  = channel.BeginRollbackTransaction(sessionHandle, null, null);
         result.AsyncWaitHandle.WaitOne();
         channel.EndRollbackTransaction(result);
     }
     catch (FaultException <NativeCLIFault> exception)
     {
         throw NativeCLIFaultUtility.FaultToException(exception.Detail);
     }
 }