public void Dispose() { if (_sessionHandle != null) { _nativeCLI.StopSession(_sessionHandle); _sessionHandle = null; } }
public NativeResult[] Execute(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations) { try { return(GetNativeSession(sessionHandle).Execute(operations)); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
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); } }
public int GetTransactionCount(NativeSessionHandle sessionHandle) { try { return(GetNativeSession(sessionHandle).Process.TransactionCount); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
public int GetTransactionCount(NativeSessionHandle sessionHandle) { try { return(_nativeServer.GetTransactionCount(sessionHandle)); } catch (NativeCLIException exception) { throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message); } }
public void BeginTransaction(NativeSessionHandle sessionHandle, NativeIsolationLevel isolationLevel) { try { GetNativeSession(sessionHandle).Process.BeginTransaction(NativeCLIUtility.NativeIsolationLevelToIsolationLevel(isolationLevel)); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
public void StopSession(NativeSessionHandle sessionHandle) { try { StopNativeSession(RemoveNativeSession(sessionHandle)); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
public void RollbackTransaction(NativeSessionHandle sessionHandle) { try { _nativeServer.RollbackTransaction(sessionHandle); } catch (NativeCLIException exception) { throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message); } }
public void BeginTransaction(NativeSessionHandle sessionHandle, NativeIsolationLevel isolationLevel) { try { _nativeServer.BeginTransaction(sessionHandle, isolationLevel); } catch (NativeCLIException exception) { throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message); } }
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); } }
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); } }
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())); }
public void RollbackTransaction(NativeSessionHandle sessionHandle) { try { GetNativeSession(sessionHandle).Process.RollbackTransaction(); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
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); } }
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); } }
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); } }
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); } }