02-06-2017 04:48 AM
I have an application that will make several calls to the Unity API to fetch documents and keywords. Is it better practice to connect and disconnect for every call or should I keep a single connection alive and use it throughout the life of the application and disconnect at the end?
Any documentation on the topic would be appreciated as well.
02-06-2017 05:45 AM
Hi Anthony
Per Hyland's best practice, a connection should remain open for the users interaction with you application. In short, you should not connect and disconnect per document or request.
Enhancements to OnBase 16 have helped provide this functionality in some cases like Web Services, where session management like this is a little more difficult.
02-06-2017 05:20 AM
Hi Anthony,
If you haven't taken it, definitely think about Hyland's API class (or push your employer to think about it).
They'll spend half a day talking about connection management, which is a good starting point even if a lot of it doesn't make sense in some technical situations and some licensing situations. That'll be a running theme- many of the "best practices" you learn there shouldn't be applied mechanically, they should be over-ridden by judgement, experience, and your situation, but the class will be a good starting point.
The best possible answer to your question will depend on what the application your developing is, the context it runs in, maybe your licensing. But as a starting point-
If your app is making a series of related calls over a short period of time, you definitely want to do it under one connection. It will keep your code simpler, it will be much more efficient at runtime (creating and closing a connection takes significant time), and it may be important for licensing depending on your situation.
So- if you're doing something like running a console app that needs to find a set of documents, retrieve metadata, and make some changes, you would almost certainly want to maintain a single connection.
If you're building a web app and thinking about one user opening a page and performing a series of operations, the answer is "it depends"- you may be trading off runtime efficiency, licensing considerations, and code complexity. You're probably going to do something that equates to "one connection per user session".
If you're building a web app and thinking about many users connecting over time, you'll probably be creating many different connections- but it still may depend a little on how you're doing licensing and other factors.
02-06-2017 05:45 AM
Hi Anthony
Per Hyland's best practice, a connection should remain open for the users interaction with you application. In short, you should not connect and disconnect per document or request.
Enhancements to OnBase 16 have helped provide this functionality in some cases like Web Services, where session management like this is a little more difficult.
02-07-2017 06:22 AM
02-08-2017 11:32 AM
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.