07-18-2013 05:18 AM
Hi,
I'm connecting to an ASAM-ODS-Server via
Call OdsOpen("AOP5", param, 0, 0)
where param is "<corba typ="sessionior">IOR_STRING</corba>". This way, I can connect as many times as I want (every time I start the script). Now I'm trying the more comfortable way with:
Set oStore = Navigator.ConnectDataStoreByParameter("AOP5", param)
This way, the connection is only created once, when I'm trying to start the script the second time I get the error message "...DataStore "NoName" can't be opened.". The old way with "OdsOpen" didn't work either (ErrorCode 104). What am I doing wrong?
With best regards,
Martin Kozlowski
DIAdem 2012
Solved! Go to Solution.
07-18-2013 08:20 AM
There is a great difference between OdsOpen and Navigator.ConnectDataStore...
OdsOpen "", "STORENAME", 0, 0
matches
dim store : set store = navigator.ConnectDataFinder(STORENAME)
OdsOpen "AOP5", "<corba typ=""sessionior"">IOR_STRING</corba>", 0, 0
matches
dim store : set store = navigator.ConnectDataStoreByParameter("AOP5", "<corba typ=""sessionior"">IOR_STRING</corba>")
And here the difference. When the variable store gets out of scope the ASAM ODS Corba session is closed. This would also happen if you terminate your
OdsOpen with the OdsClose that should match it. Else the session will stay open till the server times it out.
In your case this means the session with your IOR no longer exists after script has finished.
What would work around?
There is an additional difference.
Either way the best way to work like you do it is openeing the store in Navigator GUI. Second best is the global parameter but this one is harder to set up.
Most imports or ASAM scripts that I know work with a single open ....... and a close when script is finished.
Hope this helps
Andreas
07-18-2013 08:31 AM
Thank you very much! I will try one of the work arounds for debuging reason.
Once the script runs productively, it will be just perfect if the session is closed automatically when the store variable is out of scope