protected internal virtual void OnSessionClosed(Net.Vpc.Upa.Session session)
 {
     lock (sessions) {
         sessions.Remove(session);
         GetSessionContextProvider().SetSession(this, null);
     }
 }
 public virtual Net.Vpc.Upa.Session GetCurrentSession() /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     Net.Vpc.Upa.Session session = GetSessionContextProvider().GetSession(this);
     if (session == null)
     {
         throw new Net.Vpc.Upa.Exceptions.CurrentSessionNotFoundException();
     }
     return(session);
 }
Example #3
0
 public virtual void SetSession(Net.Vpc.Upa.PersistenceGroup persistenceGroup, Net.Vpc.Upa.Session session)
 {
     if (session == null)
     {
         GetMap().Remove(persistenceGroup);
     }
     else
     {
         GetMap()[persistenceGroup] = session;
     }
 }
 public override void PopContext(Net.Vpc.Upa.Session session)
 {
     Net.Vpc.Upa.SessionContext          currentContext = session.GetCurrentContext();
     Net.Vpc.Upa.Persistence.UConnection sconnection    = currentContext.GetParam <T>(pu, typeof(Net.Vpc.Upa.Persistence.UConnection), Net.Vpc.Upa.Impl.SessionParams.CONNECTION, null);
     if (sconnection != null && sconnection == finalConnection)
     {
         sconnection.Close();
         currentContext.SetParam(pu, Net.Vpc.Upa.Impl.SessionParams.CONNECTION, null);
         session.RemoveSessionListener(this);
     }
 }
 public virtual Net.Vpc.Upa.Session OpenSession() /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     Net.Vpc.Upa.Session session = GetFactory().CreateObject <Net.Vpc.Upa.Session>(typeof(Net.Vpc.Upa.Session), null);
     session.Init(this);
     lock (sessions) {
         sessions.Add(session);
         SetCurrentSession(session);
         session.AddSessionListener(new Net.Vpc.Upa.Impl.CloseSessionListener(this));
     }
     return(session);
 }
 public virtual void SetCurrentSession(Net.Vpc.Upa.Session session) /* throws Net.Vpc.Upa.Exceptions.UPAException */
 {
     lock (sessions) {
         if (!sessions.Contains(session))
         {
             throw new System.Exception("Session not found");
         }
     }
     CheckManagedSession(session);
     log.TraceEvent(System.Diagnostics.TraceEventType.Verbose, 60, Net.Vpc.Upa.Impl.FwkConvertUtils.LogMessageExceptionFormatter("Session Changed {0} for PersistenceGroup {1}", null, new object[] { session, GetName() }));
     GetSessionContextProvider().SetSession(this, session);
 }
Example #7
0
 public StackedSession(Net.Vpc.Upa.Session session)
 {
     this.session = session;
 }
 public virtual void PopContext(Net.Vpc.Upa.Session session)
 {
 }
 public virtual void CloseSession(Net.Vpc.Upa.Session session)
 {
 }
 private void CheckManagedSession(Net.Vpc.Upa.Session session)
 {
 }
 public override void CloseSession(Net.Vpc.Upa.Session session)
 {
     defaultPersistenceGroup.OnSessionClosed(session);
 }