public NativeSessionInfo GetNativeSessionInfoFromProcess(ServerProcess process)
        {
            NativeSessionInfo nativeSessionInfo = new NativeSessionInfo();

            nativeSessionInfo.DefaultIsolationLevel = NativeCLIUtility.IsolationLevelToNativeIsolationLevel(process.DefaultIsolationLevel);
            //LNativeSessionInfo.DefaultLibraryName = AProcess.ServerSession.CurrentLibrary.Name; // Still not sure if this makes sense...
            nativeSessionInfo.DefaultMaxCallDepth            = process.ServerSession.SessionInfo.DefaultMaxCallDepth;
            nativeSessionInfo.DefaultMaxStackDepth           = process.ServerSession.SessionInfo.DefaultMaxStackDepth;
            nativeSessionInfo.DefaultUseDTC                  = process.UseDTC;
            nativeSessionInfo.DefaultUseImplicitTransactions = process.UseImplicitTransactions;
            nativeSessionInfo.ShouldEmitIL = process.ServerSession.SessionInfo.ShouldEmitIL;
            nativeSessionInfo.UsePlanCache = process.ServerSession.SessionInfo.UsePlanCache;
            return(nativeSessionInfo);
        }
        public NativeSessionInfo GetNativeSessionInfoFromSessionInfo(SessionInfo sessionInfo, ProcessInfo processInfo)
        {
            NativeSessionInfo nativeSessionInfo = new NativeSessionInfo();

            nativeSessionInfo.DefaultIsolationLevel = NativeCLIUtility.IsolationLevelToNativeIsolationLevel(processInfo == null ? sessionInfo.DefaultIsolationLevel : processInfo.DefaultIsolationLevel);
            //LNativeSessionInfo.DefaultLibraryName = ASessionInfo.DefaultLibraryName; // This doesn't make a lot of sense in the default scenario
            nativeSessionInfo.DefaultMaxCallDepth            = sessionInfo.DefaultMaxCallDepth;
            nativeSessionInfo.DefaultMaxStackDepth           = sessionInfo.DefaultMaxStackDepth;
            nativeSessionInfo.DefaultUseDTC                  = processInfo == null ? sessionInfo.DefaultUseDTC : processInfo.UseDTC;
            nativeSessionInfo.DefaultUseImplicitTransactions = processInfo == null ? sessionInfo.DefaultUseImplicitTransactions : processInfo.UseImplicitTransactions;
            nativeSessionInfo.ShouldEmitIL = sessionInfo.ShouldEmitIL;
            nativeSessionInfo.UsePlanCache = sessionInfo.UsePlanCache;
            return(nativeSessionInfo);
        }
 public override void BeginTransaction(IsolationLevel isolationLevel)
 {
     _nativeCLISession.BeginTransaction(NativeCLIUtility.IsolationLevelToNativeIsolationLevel(isolationLevel));
 }