//-----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation.
//
//-----------------------------------------------------------------------
namespace Microsoft.Isam.Esent.Interop.Windows10
{
using Microsoft.Isam.Esent.Interop.Windows8;
///
/// An extension class to provide Values of that were introduced in Windows 10.
///
///
public static class Windows10Session
{
///
/// Gets the current number of nested levels of transactions begun. A value of zero indicates that
/// the session is not currently in a transaction. This parameter is read-only.
///
/// The to query.
/// The current transaction level of the specified database session.
public static int GetTransactionLevel(this Session session)
{
int output;
Windows8Api.JetGetSessionParameter(session.JetSesid, Windows10Sesparam.TransactionLevel, out output);
return output;
}
///
/// A client context of type that the engine uses to track
/// and trace operations (such as IOs).
///
/// The to query.
/// The operation context of the specified database session.
public static JET_OPERATIONCONTEXT GetOperationContext(this Session session)
{
JET_OPERATIONCONTEXT output;
Windows10Api.JetGetSessionParameter(session.JetSesid, Windows10Sesparam.OperationContext, out output);
return output;
}
///
/// A client context of type that the engine uses to track
/// and trace operations (such as IOs).
///
/// The to query.
/// The operation context to set.
public static void SetOperationContext(
this Session session,
JET_OPERATIONCONTEXT operationcontext)
{
Windows10Api.JetSetSessionParameter(session.JetSesid, Windows10Sesparam.OperationContext, operationcontext);
}
///
/// A 32-bit integer ID that is logged in traces and can be used by clients to
/// correlate ESE actions with their activity.
///
/// The to query.
/// The corrlation identifer of the specified database session.
public static int GetCorrelationID(this Session session)
{
int output;
Windows8Api.JetGetSessionParameter(session.JetSesid, Windows10Sesparam.CorrelationID, out output);
return output;
}
///
/// A 32-bit integer ID that is logged in traces and can be used by clients to
/// correlate ESE actions with their activity.
///
/// The to set.
/// The value to set. Internally, this is a 32-bit unsigned integer.
public static void SetCorrelationID(this Session session, int correlationId)
{
Windows8Api.JetSetSessionParameter(session.JetSesid, Windows10Sesparam.CorrelationID, correlationId);
}
}
}