Evolution SDK slow to Initialise

SOLVED

Hoping this is the right forum to be asking this...

There is a random delay when connecting to the two SQL databases using the SDK. The first time after starting my app it is instant, but thereafter there are random amounts of time that it delays. Sometimes there is zero delay, but usually there is a significant delay. Please take a look at my code below and the output at the bottom.

Using Pastel.Evolution 7.20.0.0

            Console.WriteLine(" create CommonDB conn: " + System.DateTime.Now.ToLongTimeString());
            DatabaseContext.CreateCommonDBConnection("192.168.8.111", "EvolutionCommon", "sa", "pwd", false);
            DatabaseContext.SetLicense("DExxxxxx", "xxxxxx");

            Console.WriteLine(" connect to Company: " + System.DateTime.Now.ToLongTimeString());

            DatabaseContext.CreateConnection("192.168.8.111", "CompanyDB", "sa", "pwd", false);
            Console.WriteLine(" SAGE Initialised: " + System.DateTime.Now.ToLongTimeString());

            Console.WriteLine(" fetching GL account: " + System.DateTime.Now.ToLongTimeString());
            GLAccount account = new GLAccount(accountCode);

            Console.WriteLine(" fetched: " + System.DateTime.Now.ToLongTimeString());

create CommonDB conn: 12:31:31
connect to CompanyDB: 12:31:31
SAGE Initialised: 12:31:31
fetching GL account: 12:31:31
fetched: 12:31:31


create CommonDB conn: 12:31:37
connect to CompanyDB: 12:33:32
SAGE Initialised: 12:34:33
fetching GL account: 12:34:33
fetched: 12:34:33

create CommonDB conn: 12:34:40
connect to CompanyDB: 12:34:55
SAGE Initialised: 12:35:13
fetching GL account: 12:35:13
fetched: 12:35:13 

Am I doing something wrong? I have also tried calling 

 DatabaseContext.DBConnection.Close();
 DatabaseContext.CommonDBConnection.Close();

But this has no effect.

Thanks,

Richard

Parents Reply Children
No Data