工作中遇到一个问题。
一个查询,用到了oracle的基于session的全局临时表。
每次查询结束,我都回去明确的ClosedConnection,但是Session却没减少。最后导致我临时表的数据会重复。之前我查了一下资料:http://msdn.microsoft.com/zh-cn/library/ms254502(VS.80).aspx
OLE DB .NET Framework 数据提供程序连接池
OLE DB .NET Framework 数据提供程序使用 OLE DB 会话池自动管理连接池。连接字符串参数可用于启用或禁用包括池在内的 OLE DB 服务。例如,以下连接字符串禁用 OLE DB 会话池和自动事务登记。
复制代码
Provider=SQLOLEDB;OLE DB Services=-4;Data Source=localhost;Integrated Security=SSPI;我们建议在使用完连接时一定要关闭或断开连接,以便连接可以返回池。不是显式关闭的连接可能无法返回池。例如,如果连接已超出范围但没有显式关闭,则仅当达到最大池大小而该连接仍然有效时,该连接才会返回到连接池中
。。Connection pooling by default is enabled since MDAC 2.1. It's handled by OLEDB Services, not by OLE DB provider, such as OraOLEDB. Therefore you don't need to add any in in the connection string to anable connection pooling when use OraOLEDB.
On the other hand, you can turn off some particular services in the connection string using "OLE DB Services = " as below.
All services (default)
"OLE DB Services = -1;"
All except pooling and automatic transaction enlistment
"OLE DB Services = -4;"
All except Client Cursor Engine
"OLE DB Services = -5;"
All except pooling, automatic transaction enlistment, and Client Cursor Engine
"OLE DB Services = -8;"
Pooling and automatic transaction enlistment only, session level aggregation only
"OLE DB Services = 3;"
No services
"OLE DB Services = 0;"
大家有没有这方面的资料。 这个 OLE DB Services 都是怎么使用的。
我是穷人,没什么分。
一个查询,用到了oracle的基于session的全局临时表。
每次查询结束,我都回去明确的ClosedConnection,但是Session却没减少。最后导致我临时表的数据会重复。之前我查了一下资料:http://msdn.microsoft.com/zh-cn/library/ms254502(VS.80).aspx
OLE DB .NET Framework 数据提供程序连接池
OLE DB .NET Framework 数据提供程序使用 OLE DB 会话池自动管理连接池。连接字符串参数可用于启用或禁用包括池在内的 OLE DB 服务。例如,以下连接字符串禁用 OLE DB 会话池和自动事务登记。
复制代码
Provider=SQLOLEDB;OLE DB Services=-4;Data Source=localhost;Integrated Security=SSPI;我们建议在使用完连接时一定要关闭或断开连接,以便连接可以返回池。不是显式关闭的连接可能无法返回池。例如,如果连接已超出范围但没有显式关闭,则仅当达到最大池大小而该连接仍然有效时,该连接才会返回到连接池中
。。Connection pooling by default is enabled since MDAC 2.1. It's handled by OLEDB Services, not by OLE DB provider, such as OraOLEDB. Therefore you don't need to add any in in the connection string to anable connection pooling when use OraOLEDB.
On the other hand, you can turn off some particular services in the connection string using "OLE DB Services = " as below.
All services (default)
"OLE DB Services = -1;"
All except pooling and automatic transaction enlistment
"OLE DB Services = -4;"
All except Client Cursor Engine
"OLE DB Services = -5;"
All except pooling, automatic transaction enlistment, and Client Cursor Engine
"OLE DB Services = -8;"
Pooling and automatic transaction enlistment only, session level aggregation only
"OLE DB Services = 3;"
No services
"OLE DB Services = 0;"
大家有没有这方面的资料。 这个 OLE DB Services 都是怎么使用的。
我是穷人,没什么分。
解决方案 »
- 存储过程中创建表?
- 为什么连接池还有连接,但是系统确报取不到连接呢?
- ORA-02019: 未找到远程数据库的连接说明 急!!!
- 谁能提供一个Oracle数据库的导出数据字典工具。急!!!
- Oracle里如何解决4000字符的问题?Struts+spring+ibatis环境。
- 怎样在odbc设置,使能在程序中调用用户OFFICESYS的表和视图等数据库对象
- ACCESS中的“备注”类型怎么导入ORACLE,要把ORACLE设置成什么类型
- TO:duanzilin(寻) .waterfirer(水清) 帮忙再改一下这个过程.
- 抱怨!抱怨!抱怨!oracle要自己手写视图!!!!
- 怎样用PRO*C从ORACLE数据库中按一定条件提出一些记录并写到一个格式化的文本里?
- 复杂的oracle procedure优化问题
- oracle 10g 做了RAC怎么实现负载均衡
目前这么处理似乎没什么问题。不过我想知道更多的关于oracle下 会话池的控制。
谢谢楼上。