Ejemplo n.º 1
0
        public virtual void AddSession(NeoDatis.Odb.Core.Transaction.ISession session)
        {
            string id = NeoDatis.Tool.Wrappers.OdbThread.GetCurrentThreadName() + session.GetBaseIdentification
                            ();

            sessions.Add(id, session);
            if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
            {
                NeoDatis.Tool.DLogger.Debug("Associating id = " + id + " to session " + session.GetId
                                                ());
            }
        }
Ejemplo n.º 2
0
        //ISession session = sessions.remove(id);
        //session.close();
        //session = null;
        public virtual System.Collections.Generic.IList <string> GetSessionDescriptions(System.Collections.IDictionary
                                                                                        connectionManagers)
        {
            System.Collections.Generic.IList <string> l = new System.Collections.Generic.List <
                string>();
            System.Collections.Generic.IEnumerator <string> iterator = sessions.Keys.GetEnumerator
                                                                           ();
            string sid = null;

            NeoDatis.Odb.Core.Transaction.ISession session           = null;
            NeoDatis.Odb.Core.Server.Connection.ConnectionManager cm = null;
            System.Text.StringBuilder buffer = null;
            while (iterator.MoveNext())
            {
                sid     = iterator.Current;
                session = sessions[sid];
                cm      = (NeoDatis.Odb.Core.Server.Connection.ConnectionManager)connectionManagers[session
                                                                                                    .GetBaseIdentification()];
                buffer = new System.Text.StringBuilder("Session " + sid + " : " + session.ToString
                                                           ());
                if (cm != null)
                {
                    buffer.Append(" - Number of connections=" + cm.GetNbConnections());
                    buffer.Append(cm.GetConnectionDescriptions());
                }
                l.Add(buffer.ToString());
            }
            return(l);
        }