Exemplo n.º 1
0
 public NativeResult[] Execute(NativeSessionHandle sessionHandle, NativeExecuteOperation[] operations)
 {
     try
     {
         return(GetNativeSession(sessionHandle).Execute(operations));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Exemplo n.º 2
0
 public int GetTransactionCount(NativeSessionHandle sessionHandle)
 {
     try
     {
         return(GetNativeSession(sessionHandle).Process.TransactionCount);
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Exemplo n.º 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);
     }
 }
Exemplo n.º 4
0
 public void RollbackTransaction(NativeSessionHandle sessionHandle)
 {
     try
     {
         GetNativeSession(sessionHandle).Process.RollbackTransaction();
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Exemplo n.º 5
0
 public void BeginTransaction(NativeSessionHandle sessionHandle, NativeIsolationLevel isolationLevel)
 {
     try
     {
         GetNativeSession(sessionHandle).Process.BeginTransaction(NativeCLIUtility.NativeIsolationLevelToIsolationLevel(isolationLevel));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Exemplo n.º 6
0
 public void StopSession(NativeSessionHandle sessionHandle)
 {
     try
     {
         StopNativeSession(RemoveNativeSession(sessionHandle));
     }
     catch (Exception exception)
     {
         throw NativeCLIUtility.WrapException(exception);
     }
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
 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);
     }
 }
Exemplo n.º 9
0
 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);
     }
 }
Exemplo n.º 10
0
 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);
     }
 }
Exemplo n.º 11
0
        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);
        }