on 08-10-2016 11:03 PM
Performancewise and resourcewise, what's better?
Right now, I open and close the connection every time I want to post a transaction (like an object.update or object.add) but I am not really sure if this is considered a bad practice. I do it this way because I don't like to keep a connection open while the add-on is alive... but I want to know which one is considered a best practice
Company.Connect() at the start of the Add-On and Company.Disconnect() before closing it
vs
Companny.Connect() <DoSomething> Company.Disconnect()
I hope you guys and gals can enlight me
EDIT
I am using SAP Business One 9.1 over SQL Server 2012.
Hi Hector,
Connecting to SBO has a very high overhead.
I would keep the connection open through all the session.
If you addon is connected to a running SBO, you can use the company connection of the SBO addon instead of connecting your self.
oCompany = SBOApplication.Company.GetDICompany as SAPbobsCOM.Company;
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.