Reputation:
Using Oracle's ODP.NET library, the application I'm working on needs to perform two different types of queries, where one type can be relatively slow, but the other must be fast. The current application code I've inherited disables connection pooling entirely and keeps a specific connection object open for the "fast" query, which is great for that purpose because we can switch to another open connection if the first call has taken more than X milliseconds, alerting the user that the data didn't return fast enough if the second call doesn't come back quickly enough.
At the same time, having changed the connection string to enable pooling, the general queries we run come back much faster, so it'd be nice to use pooling for those queries.
Is there a way I can enable pooling for most purposes, but disable it for specific connection objects? Or would it be easier (since we've already got code basically "pooling" two connections for the critical query) to just extend the existing code to rotate through a small collection of connection objects for the general queries, and keep two other connections separate for the more critical query?
Upvotes: 0
Views: 948
Reputation:
In the article @Mino linked to here, it states:
If any one of the connection string parameters is modified, ODP.NET will create a new connection pool for your application when the next connection is requested.
Extending and clarifying that statement based on the information from Visual Studio's debugger and the disassembly tool JustDecompile, I'm confident that:
Oracle's connection pooling really is smart enough to do what I wanted. All of this investigated with Oracle.ManagedDataAccess.dll v4.121.1.0 as part of the ODAC 12.1.0.1.0 with Oracle Developer Tools for Visual Studio
package from Oracle.com.
Upvotes: 1