Sharing oo4o connection pool IIS and C++

From: <jejablonski_at_my-deja.com>
Date: Wed, 08 Nov 2000 19:41:06 GMT
Message-ID: <8uca8h$4ub$1_at_nnrp1.deja.com>


[Quoted] I'm wondering if it's possible to use Oracle Objects for OLE (oo4o) in a coordinated way from both ASP pages coded in VBScript and COM objects coded in C++? I'm using oo4o inside a COM object successfully when I create a C++ ODatabase object and call the database through it. I'm trying to figure out how to create an OSession object with Application scope which can manage a pool of database connections to be used by multiple ASP pages and COM objects.

Following the examples, I have declared an object with application scope in my Global.asa file. I can use this object from any number of ASP pages. The trouble is in passing a reference to this object into my C++ COM objects. I've tried storing a reference to the object in the Application namespace which I can access in the COM object. The code in C++ seems to be retrieving something from the IVariantDictionary object holding the entities in the application namespace, I'm just not sure how to use the value I'm getting.

I've tried declaring the thing as a CComPtr<Iunknown>, but then the compiler won't recognize any of the method calls which it would if I had the definition for something like an IOSession. I'm able to call methods on the application object by declaring a pointer to it as CComPtr<IApplicationObject>. It seems I need to do something similar with the OSession object.

Alternatively, I'd settle for being only able to share the connection pool between different COM objects. For this approach I've defined a dedicated COM object which uses the C++ syntax to declare an OSession object, and I keep a reference to this dedicated object in the application namespace. Now, my other COM objects need to gain access to this object and run a method which returns some king of usable reference to the OSession. Again I'm in a bit over my head and I start to worry about the safety of passing reference to C++ objects from one COM object to another. It seems I need to learn a lot more about COM and maybe need to know some of the internals of the implementation of oo4o.

I'm also open to the notion that I'm going about this the wrong way and trying to accomplish an unnatural act. Any advice you can offer is most appreciated.

--John

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Nov 08 2000 - 20:41:06 CET

Original text of this message