Provides the information for a user in a database system
        public AuthenticatedSession(User user, IDatabaseConnection connection)
        {
            if (user == null)
                throw new ArgumentNullException("user");
            if (connection == null)
                throw new ArgumentNullException("connection");

            User = user;
            Connection = connection;
        }
Beispiel #2
0
        public SessionInfo(int commitId, User user, TransactionIsolation isolation, ConnectionEndPoint endPoint)
        {
            if (user == null)
                throw new ArgumentNullException("user");
            if (endPoint == null)
                throw new ArgumentNullException("endPoint");

            CommitId = commitId;
            User = user;
            EndPoint = endPoint;
            Isolation = isolation;
            StartedOn = DateTimeOffset.UtcNow;
        }
Beispiel #3
0
        public SystemSession(ITransaction transaction, string currentSchema)
        {
            if (String.IsNullOrEmpty(currentSchema))
                throw new ArgumentNullException("currentSchema");
            if (transaction == null)
                throw new ArgumentNullException("transaction");

            CurrentSchema =currentSchema;
            Transaction = transaction;
            Context = transaction.Context.CreateSessionContext();
            Context.RegisterInstance(this);

            User = new User(this, User.SystemName);

            startedOn = DateTimeOffset.UtcNow;

            Access = new SessionAccess(this);
        }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionInfo"/> class that
 /// references an established session to the database.
 /// </summary>
 /// <param name="commitId">The unique commit identifier.</param>
 /// <param name="user">The user that owns the session.</param>
 /// <param name="isolation">The isolation level of the session.</param>
 /// <remarks>
 /// This constructor sets the origin connection end point as embedded.
 /// </remarks>
 public SessionInfo(int commitId, User user, IsolationLevel isolation)
     : this(commitId, user, isolation, ConnectionEndPoint.Embedded)
 {
 }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionInfo"/> class.
 /// </summary>
 /// <param name="commitId">The commit identifier.</param>
 /// <param name="user">The user.</param>
 public SessionInfo(int commitId, User user)
     : this(commitId, user, IsolationLevel.Unspecified)
 {
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionInfo"/> class that has
 /// no unique commit identification.
 /// </summary>
 /// <param name="user">The user that owns the session.</param>
 /// <param name="isolation">The isolation level of the transaction.</param>
 public SessionInfo(User user, IsolationLevel isolation)
     : this(-1, user, isolation)
 {
 }
Beispiel #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionInfo" /> class for the
 /// given user.
 /// </summary>
 /// <param name="user">The user that owns the session.</param>
 public SessionInfo(User user)
     : this(user, IsolationLevel.Unspecified)
 {
 }
Beispiel #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SessionInfo" /> class.
 /// </summary>
 /// <param name="user">The user that owns the session.</param>
 /// <param name="isolation">The isolation level of the transaction.</param>
 /// <param name="endPoint">The source end point of the session.</param>
 public SessionInfo(User user, IsolationLevel isolation, ConnectionEndPoint endPoint)
     : this(-1, user, isolation, endPoint)
 {
 }
Beispiel #9
0
 public static IUserSession CreateUserSession(this IDatabase database, User user)
 {
     // TODO: get the pre-configured default transaction isolation
     return database.CreateUserSession(new SessionInfo(user));
 }
Beispiel #10
0
 public SessionInfo(int commitId, User user)
     : this(commitId, user, TransactionIsolation.Unspecified)
 {
 }
Beispiel #11
0
 public SessionInfo(User user, TransactionIsolation isolation)
     : this(-1, user, isolation)
 {
 }
Beispiel #12
0
 public SessionInfo(User user)
     : this(user, TransactionIsolation.Unspecified)
 {
 }
Beispiel #13
0
 public SessionInfo(User user, TransactionIsolation isolation, ConnectionEndPoint endPoint)
     : this(-1, user, isolation, endPoint)
 {
 }