示例#1
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);
     }
 }
示例#2
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);
     }
 }
示例#3
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);
     }
 }
示例#4
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);
     }
 }
示例#5
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);
     }
 }