02-11-2016 11:57 AM
If I run a script and use OpenDataStoreByParameter, how can I access that particular connection in future runs of that script?
So, the problem is, it seems, every time I use OpenDataStoreByParameter, our server creates a new connection, and checks out a new license. Even if I use the datastore.close procedure, it appears the server license is still checked out. This causes our ODS server to stop responding since it is out of licenses, which is a problem. We are still looking into why the server doesn't release the license, even when I use the close procedure, but in the meantime...
Is there any way for me to check a previous connection to an AOP5 database if I use OpenDataStoreByParameter?
02-12-2016 07:58 AM
What DIAdem does:
What does close do?
In your case it seems that you opened the store multiple times. And that some
elements of the second store remain active. Global variables, script not finished and not set to nothing, ...
Option Explicit Dim myDataStoreParam: myDataStoreParam = "<cfg loglevel=""2""></cfg><corba typ=""locator""><server port=""900"">10.89.2.24</server><path>ENGINE1.ASAM-ODS</path></corba><user>System</user><pwd e=""1"">puma</pwd>" dim store1 : set store1 = Navigator.ConnectDataStoreByParameter("AOP5", myDataStoreParam) dim store2 : set store2 = Navigator.ConnectDataStoreByParameter("AOP5", myDataStoreParam) dim store3 : set store3 = Navigator.ConnectDataStoreByParameter("AOP5", myDataStoreParam & AlwaysOpenParam) dbm "DIA: **** Close store1" store1.Close dbm "**** Set store1 to nothing" set store1 = nothing dbm "DIA: **** store1 is not closed because still store2 reference" dbm "DIA: **** Close store3" store3.Close dbm "DIA: **** Store3 closed by calling AoSession::close" dbm "DIA: **** Set store3 to nothing wll cause no action" set store3 = nothing dbm "DIA: **** Store2 still has first connection" dbm "DIA: **** Script will finish now and automatically release store2" Function AlwaysOpenParam() AlwaysOpenParam = "<alwaysopennew>" & Cstr(CDbl(now)) & CStr(rnd(1000)) & "</alwaysopennew>" end function
Can show this behavior.
Use DebugView to see the following lines.
[22624] DIA: **** Close store1 [22624] DIA: **** store1 is not closed because still store2 reference [22624] DIA: **** Close store3 [22624] AOP5: Info(00): Closing AoSession! [22624] DIA: **** Store3 closed by calling AoSession::close [22624] DIA: **** Set store3 to nothing wll cause no action [22624] DIA: **** Store2 still has first connection [22624] DIA: **** Script will finish now and automatically release store2 [22624] AOP5: Info(00): Closing AoSession!
Why does it behave this way. Its done to avoid using to may licenses. So opening with the same parameters will reuse the connection.
But in your case it causes the system not to close.
The question is. Where do you store references to instances connected to a store.
02-15-2016 08:34 AM - edited 02-15-2016 08:38 AM
Thanks Andreas. With your information, I was able to better understand the AOP5 log. I was careful to ensure that each instance I called the connect data store by parameter function, I was calling the oDataStore.Close method as well.
So, It appears that I am closing the data store properly, as I get the "Closing AoSession" in my log. It appears the issue may not be with Diadem.
Thanks.