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

            User = user;
            Connection = connection;
        }
Esempio n. 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;
        }
Esempio n. 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);
        }
Esempio n. 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)
 {
 }
Esempio n. 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)
 {
 }
Esempio n. 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)
 {
 }
Esempio n. 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)
 {
 }
Esempio n. 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)
 {
 }
Esempio n. 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));
 }
Esempio n. 10
0
 public SessionInfo(int commitId, User user)
     : this(commitId, user, TransactionIsolation.Unspecified)
 {
 }
Esempio n. 11
0
 public SessionInfo(User user, TransactionIsolation isolation)
     : this(-1, user, isolation)
 {
 }
Esempio n. 12
0
 public SessionInfo(User user)
     : this(user, TransactionIsolation.Unspecified)
 {
 }
Esempio n. 13
0
 public SessionInfo(User user, TransactionIsolation isolation, ConnectionEndPoint endPoint)
     : this(-1, user, isolation, endPoint)
 {
 }