public NativeResult[] Execute(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations) { try { return(GetNativeSession(sessionHandle).Execute(operations)); } 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 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 void RollbackTransaction(NativeSessionHandle sessionHandle) { try { GetNativeSession(sessionHandle).Process.RollbackTransaction(); } catch (Exception exception) { throw NativeCLIUtility.WrapException(exception); } }
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 static NativeParam[] DataParamsToNativeParams(IServerProcess process, DataParams dataParams) { NativeParam[] nativeParams = new NativeParam[dataParams.Count]; for (int index = 0; index < dataParams.Count; index++) { var dataParam = dataParams[index]; var nativeValue = DataParamToNativeValue(process, dataParam); nativeParams[index] = new NativeParam() { Name = dataParam.Name, Modifier = NativeCLIUtility.ModifierToNativeModifier(dataParam.Modifier), Value = nativeValue }; } return(nativeParams); }
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 static DataParams NativeParamsToDataParams(ServerProcess process, NativeParam[] nativeParams) { DataParams dataParams = new DataParams(); if (nativeParams != null) { foreach (var nativeParam in nativeParams) { var value = NativeValueToDataValue(process, nativeParam.Value); DataParam dataParam = new DataParam ( nativeParam.Name, value.DataType, NativeCLIUtility.NativeModifierToModifier(nativeParam.Modifier), value.IsNil ? null : (value is IScalar ? value.AsNative : value) ); dataParams.Add(dataParam); } } return(dataParams); }