Wednesday, September 04, 2002 | |
Microsoft's terms for COM+ instance management algorithms are very confusing. Object Pooling means more or less what you might think - a pool of object instances that can be connected to an incoming request at need. Instance Pool would be a better term, but I can let this slide. In Microsoft's parlance, a COM+ managed object is either pooled or it is not. This is crucial to understand. This makes it clearer that Just In Time Activation is not a mutually exclusive condition - even thought it sounds like it is. JITA actually refers to lazy binding of the client-side proxy to a stub - but has nothing to do with the actual binding to an instance. Thus a developer can try the following combinations:
2:33:12 PM Google It! |
I did a little research on connection pooling. Here are some interesting, if inconclusive, excerpts from the MSDN Library. Connection pooling is available in the following ways. So, it looks like ODBC does provide connection pooling. It is somehow enabled by ASP. If you are writing MTS (and, I assume, COM+) apps you should use object pooling to get the same effect. Ah, here is an MSDN article with more detailed info on ODBC connection pooling. Excerpts... To take advantage of connection pooling, a driver must be thread-safe.On my Windows 2000 machine I could not find anything under the "Connection Pooling" tab that allowed me to control connection pooling by driver. I could only enable/disable performance monitoring of the connection and set the Retry Wait Time. Digging further into the previous article, I did find that you can also control connection pooling, on a per driver basis, through the registry. For example, the key HKEY_LOCAL_MACHINESOFTWAREODBCODBCINST.INISQL Server contains a value of CPTimeout that controls how long the connection should be kept in a pool until it is released (closed). Setting the value to zero disables connection pooling. Oh, so that's how you do it! I found that by double-clicking the driver name in the Connection Pooling dialog of the ODBC Administrator) another dialog pops up that allows you to configure pooling parameters. Unintuitive, but it does work. |
My friend George and I have a minor disagreement on where database connection pooling is performed in the .NET/ODBC/COM+ world and in the WebSphere/JDBC world. I believe I read in Roger Sessions book COM+ and the Battle for the Middle Tier that ODBC does the connection pooling, not COM+ (or even ADO). I believe he also states that JDBC handles its own connection pooling rather than WebSphere. I do not know WebSphere/JDBC any where near well enough to prove or disprove this assertion. However, I should be able to design an experiment to determine the truth on the .NET/COM+ platform. I wonder how I should go about this? |
I have been playing around with using COM+ services in .NET and have learned some hard lessons. First, while .NET does a really nice job of automatically registering a .NET implemented COM+ component, it does so only the first time the component is created. You have to do it manually thereafter. Since it is likely during development that you will frequently change the component, you will have to resort to manual registration. It turns out this is relatively painless and provides better feedback on errors to boot. Even after learning this I had trouble with the manual registration. It turns out that an early development attempt had resulted in a registration I was unaware of under an application name I was unaware of. I found that uninstalling that application (regsvcs /u appname dllName) solved that problem. Then I was able to successfully register the component (regsvcs dllName). From then on I re-registered with every change to the dll (regsvcs /reconfig dllName). See the .NET Framework SDK Documentation for more info. |