How to close COM connection

1C:Enterprise platform integration capabilities and techniques

#1
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

Hello!

I have a problem with understanding the COM connection. I do the following:

Code
   Com = New COMObject("V82.COMConnector");
   Connection = Com.Connect("Srvr=server:1541;Ref=infobase;Usr=Administrator;Pwd=*****");

But can not understand how to close the connection. Sometimes it closes before I need to use it and sometimes it remains open when it is not needed.

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

I think the platform should close the connection with the destruction of the variable.
You can close it forceably by setting Conn = Undefined;

 
#3
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

And what can I do to force it not to close the connection between procedure calls until the user closes the main application?

 
#4
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Use a variable of the module

 
#5
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

If you want to use com object within all user session you should insert it into session parameter using temporary storadge

Code
SessionParameters.YourParametr=PutToTempStorage(Conn, New UUID)

 
#6
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

Thanks, Alexey. But wouldn't it destroy a COM object when procedure which places it into temp storage ends?

 
#7
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

Please explain your task.
Do you want to use the same com object during all user session or just one server call?

 
#8
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

I want to run a supplementary 1C:Enterprise instance with another application for interacting with it during all session of users with the given role. Users of this role should enter data in realtime to be used by users working in both applications. Due to security reasons we would like to have separate application for storing secret information.

 
#9
People who like this:0Yes/0No
Just came
Rating: 1
Joined: Nov 2, 2011
Company:

Xin Wang, did you consider web-services?

 
#10
People who like this:0Yes/0No
Active user
Rating: 6
Joined: Sep 16, 2011
Company:

No, I'm doing some integration with Microsoft Office applications. Why?

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.