public NativeSessionHandle StartSession(NativeSessionInfo sessionInfo) { try { return(_nativeServer.StartSession(sessionInfo)); } catch (NativeCLIException exception) { throw new FaultException <NativeCLIFault>(NativeCLIFaultUtility.ExceptionToFault(exception), exception.Message); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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; } }
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); }
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); } }
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); } }
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); } }
public NativeSession(NativeSessionInfo nativeSessionInfo) { _iD = Guid.NewGuid(); _nativeSessionInfo = nativeSessionInfo; }
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); }