DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to close a database connection in the new Navigator

Solved!
Go to solution

Hi @ all,

 

with the new navigator-object it's easy to connect to a database with the methods 'ConnectDataStore' or 'ConnectDataStoreByParameter'.

But how the connection may be closed?

 

In an AsamOds environment it's important to close the connection, because a part of the environment (the so called ORB) 'caches' some data (in the ActiveObjectMap). This 'cache' is cleaned up by closing the connection. So, the problem is, that without the possibility to close a connection, the cache will grow up (and in our way the Orb ist becoming instable and crashes after a while).

 

 

Thanks for reading 🙂

 

Greetings from Germany

Contur

0 Kudos
Message 1 of 3
(3,898 Views)
Solution
Accepted by topic author Contur

Hi Contur,

 

the new ASAM-ODS API does not have an explicit close method. A store (and by this the connection held by this store) will be closed automatically when all references to this store are closed - which translates in VBS to set them to Nothing. In the simplest case this is the store itself:

 

 

dim myStore : set myStore = Navigator.ConnectDataStore("ASAM Pass Fail Analysis Example")

set myStore = Nothing

 

 

In the case your script helds any other references to that store, e.g. the results of a query or a certain element you need to set them to Nothing as well

 

 

dim myStore : set myStore = Navigator.ConnectDataStore("ASAM Pass Fail Analysis Example")

 

dim myRootElements : set myRootElements = myStore.RootElements
set myRootElements = Nothing

set myStore = Nothing

 

 

 

 

 

0 Kudos
Message 2 of 3
(3,890 Views)

Hi Stefan,

 

big thanks for your reply.

 

I which you a nice day.

 

Greeting from Germany

Contur

0 Kudos
Message 3 of 3
(3,888 Views)