Urgent :  New AFDatabase won't be available in Databases list

Discussion created by sandeep.narang on Aug 28, 2011
Latest reply on Aug 29, 2011 by hanyong

Hi Team,


We are using a WCF service to connect to AF Server/ AFDatabase and this Will be used by a windows application. we are using the following piece of code to connect to the server/database.

    PISystems systems = new PISystems();
    if (systems.Contains(afServerName))
         this.AFServer = (PISystem)systems[afServerName];
         throw new Exception("Connection Error: Server (" + afServerName + ") doesn't exist");

    if (this.AFServer != null && this.AFServer.ConnectionInfo.IsConnected == false)
         this.AFServer.Connect(new System.Net.NetworkCredential(userId, password));

    if (AFServer.Databases.Contains(afDatabaseName))
         this.Database = AFServer.Databases[afDatabaseName];
         throw new Exception("Connection Error: Database (" + afDatabaseName + ") doesn't exist");

Catch(Exception ex)
    throw new Exception("Connection Error: " + ex.Message);



Now we are facing below issue :

When we add a new database to PI AF Server and when we try to access the new database through our service/code. We are unable to find the database name in a list.


Please assist us on it.


Note : If we restart our service, it works fine.