list of connected users outdated

1045
1
01-10-2017 04:01 AM
Highlighted
New Contributor II

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 serv... 

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

Reply
0 Kudos
1 Reply
Highlighted
New Contributor II

Found solution.

I could execute the code given in How To: Remove orphaned keyset tables in Oracle  with the same command. But I had to exchagne the "sde". by the current user schema that I am working with. Only problem is the user rights needed.

Reply
0 Kudos