AnsweredAssumed Answered

list of connected users outdated

Question asked by GD_Lionel on Jan 10, 2017
Latest reply on Jan 23, 2017 by GD_Lionel

Hallo everyone,

We switched to direct connect and are experiencing different problems. One of them is, that the list of users, that are "currently" connected to database, is having orphaned entries. (ArcGIS 10.2.1 on oracle 11g) 

To obtain the users we more or less followed the arctical here:How To: Obtain a listing of user processes and locks from a geodatabase when there is no ArcSDE service 

Our current code lookes like that:

 private static List<UserObject> ReadUsersFromOracle()
{
     var result = new List<UserObject>();
     using (var connection = new Oracle.DataAccess.Client.OracleConnection(ConnectionString))
     {
          connection.Open();
          try
          {
               var getuserCommand = "SELECT SDE_ID, OWNER, NODENAME, START_TIME, XDR_NEEDED, DIRECT_CONNECT FROM PROCESS_INFORMATION";
               var command = new Oracle.DataAccess.Client.OracleCommand(getuserCommand, connection);
               command.CommandType = System.Data.CommandType.Text;

               var reader = command.ExecuteReader();
               while (reader.Read())
               {
                    var sdeid = Convert.ToDecimal(reader[0]);
                    var user = Convert.ToString(reader[1]);
                    var nodeName = Convert.ToString(reader[2]);
                    var connTime = Convert.ToDateTime(reader[3]);
                    var xdr = Convert.ToString(reader[4]);
                    var isDc = Convert.ToString(reader[5]);
                    result.Add(new UserObject(sdeid, user, nodeName, connTime, xdr, isDc));
               }

          }
          finally
          {
               connection.Close();
          }
     }
     return result;
}

Does anyone has an idea, how to trigger any update so that the list returns only actually connected users?

 

Kind regards,

 

Lionel

Outcomes