db connection pool across processes

假装没事ソ 提交于 2019-12-02 02:02:46

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).

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