db connection pool across processes

耗尽温柔 提交于 2019-12-20 03:01:31

问题


We have a client/server application that consists of multiple EXEs. The data access layer is on the same physical tier as the client in a library shared by our EXE modules. ODBC and OleDB connection pools are managed per-process; are there techniques for sharing DB connections across processes (other than moving the data access layer to a middle tier)?


回答1:


Database connections in OLEDB and ODBC are intrinsically process bound. At the lowest levels, a sql server database connection is using an IPC mechanism like named pipes, shared memory, or tcp sockets. Other databases probably use network connections exclusively. If you think about it, to share a connection pool and hence connections you would need to copy these low level objects (sockets, named pipe, shared memory section) to another process and then allow them to manage them. Even if you could hand them off you wouldn't be able to use them concurrently.

To do what you want to do you really have to move the data access layer into a shared space that all of your multiple exes want to use. This is usually a middle tier and each exe would then communicate with that via some IPC mechanism (.net remoting, com server, RPC, networking, etc).



来源:https://stackoverflow.com/questions/365984/db-connection-pool-across-processes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!