开发者

Storing connection to 3rd party backend per session

开发者 https://www.devze.com 2023-03-12 04:22 出处:网络
I have a 3rd party backend which is accessed on a per s开发者_JAVA技巧ession basis and required one connection per user (I don\'t expect more than ~1100 concurrent connections).

I have a 3rd party backend which is accessed on a per s开发者_JAVA技巧ession basis and required one connection per user (I don't expect more than ~1100 concurrent connections).

How would I go about storing this connection in a session?


You wouldn't -- that sort of thing is a total server killer. It will slow your system down to a halt. Unless maybe if you can keep your sessions (including timeouts) really short.

Is a mechanism such as connection pooling no option for your system? Then you don't need to store anything in session -- just, every time you need a connection, ask for one and release it as soon as you've used it. See http://en.wikipedia.org/wiki/Connection_pool.

0

精彩评论

暂无评论...
验证码 换一张
取 消