OO4O and .NET - OO4O and Wizards(Archived)

Is OO4O supported under .NET through COM interop? Will it be supported going forward?
I was able to add the library to a C# project and write some simple code. However, I noticed that when I manually ran "tlbimp" against the type library, I got quite a few warnings (especially WRT BLOB and CLOB column methods and arrays methods) about "arguments cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate".
I saw one post in this forum on the subject, I wonder also if anyone else has investigated this further.
Thanks.

Related

PHP extension seemingly incomplete and also unusable on 64 bit systems

How much maintenance does the PHP extension get now that DbXML has moved to oracle's hands?
The first problem I noticed was that the extension threw std::bad_alloc exceptions after I compiled and tried to use it on a 64 bit system. The fix was simple (I posted a patch on another thread) - the extension was passing long typed variables by reference when the argument parsing functions expected int.
Now that I had a working extension, I went to work playing with it and noticed a few missing pieces of the API. Specifically the XmlResolver class isn't available from within PHP and the functions setDefaultCollection and getDefaultCollection weren't available on the XmlQueryContext object. I was able to add the default collection functions successfully myself, but I'm quite a bit out of my league in understanding why the XmlResolver code is intentionally turned off in the extension's sources. Were there problems getting it to work?
I would like to use dbxml in an existing PHP project, but not having the ability to subclass XmlResolver will cause me some headaches.
Any help and / or direction would be greatly appreciated. 
Hi Donovan,
We try to keep the PHP extension up to date, and certainly always compile and test with it. Clearly we need to do more on 64bit systems, as your patch demonstrates.
Whilst calling C++ from PHP is a relatively simple problem, calling PHP classes from C++ is considerably harder. For this reason I don't believe that we have managed to get subclassing of XmlResolver from PHP working. If you have any input on making it work I would be happy to hear from you.
What problems do you need the XmlResolver class to solve? There may be another way to accomplish what you need.
John 
Donovan,
To expand on John's response, if you were to provide some code that enabled the XmlResolver callbacks into PHP I'd be happy to integrate it.
Regards,
George 
Sorry for the delayed response.
My dbxml container files will actually be stored remotely and I was hoping to use the XmlResolver class to do two things:
1. dynamically "alias" available containers - meaning I would resolve an alias at usage and not have to define them beforehand
2. provide me with a hook to know when a container is being used in an arbitrary xquery so that I can ensure that it is synchronized to a local cache directory (auto open flag is set).
Right now, I have to either limit the containers available to a explicit subset and turn off the auto open flag or I have to synchronize all of the available containers and alias them beforehand (their file names will not match the names I'd like my end users to reference them by).
So, would a custom resolver be appropriate for this? or should I approach it from another direction? 
Hi Donovan,
In version 2.3.10, XmlResolver is not up to this job - a couple of reasons:
1) Nothing using the "dbxml:" scheme is passed to the XmlResolver for resolution, it is all handled directly by DB XML. It is essential for our optimisations that we control this URI scheme. This means that if you wanted to go ahead with your plan, you would have to access your containers using a different URI scheme.
2) Results returned to a query by an XmlResolver method currently are not optimised in any way using the container's indexes. This will be implemented in the next version of DB XML, but I suspect would be a complete showstopper for you now.
John 
1. Wouldn't setting the baseURI override the dbxml:// default?
2. It actually might not be, in normal expected usage there will be a default collection defined and it will be the main container in use, so it would still be using indexes. The use of other containers is more for completeness in functionality than necessity at the moment. I'm glad to know that bit of information though, might save me time later. 
Setting the base URI can certainly be a way to avoid using "dbxml://" URIs.
John

OO4O in NET framework

As there is no immediate plan to make object-relational features in ODP.NET, does Oralce plan to release any bridge to make OO4O accessible from .NET framework? 
Hi!
You can already use OO4O in .NET through COM Interop. Right click on References/Add References.
Then choose the COM tab and select the Oracle InProc Server.
There you go!
You noticed that all classes have been prefixed with "Class". So the session object is now called "OraSessionClassClass".
For some reasons, almost all functions in OO4O returns objects. So, if you're in C# or in VB.NET with the strict option on, you'll have some type casting to do.
But if you need Oracle advanced features, please try ODP.NET. From the tests I ran here, it's at least twice faster than OO4O.
Mat 
Indeed ODP is much easier for developing with .net.
The typecasting needed to be done for OO4O is very annoying (especially because the documentation is not comprehensive and one should guess what types are expected or returned in any function or property).
Do you know about better documentation for OO4O?
Can ODP substitute OO4O?
What about objects access (I have a special interest in SDO objects)?

Stored procedures in Pro C

I know that stored procedures for Oracle are
written in PL/SQL, and now you could also
do so using Java. I am, however, interested
in knowing if it is possible to write stored
procedures in C (actually Proc-C), for
performance reasons. Essentially, one should
be able to create a dll out of the Pro-C code
and somehow make the Oracle server to attach
the dll on demand, when I invoke the stored
procedure.
Don't know if any of this is possible. If
yes, then I would very much like to know more
about it, with some sample code or some pointer to documentation.
Thanks.
null

Trouble with COM cartridge (sorry if OT)

I apologise if this isn't the proper forum for this question, but it seemed the closest fit. Please kindly direct me to the proper forum if not.
I'm having some difficulty with the COM cartridge and a COM object we use here at the university to authenticate against our campus DCE single sign-on mechanism. Basically, a method of this object allows me to bounce a user ID and password off of DCE and determine if it's valid.
I don't have a problem instantiating the object or calling the method, but it will never return a successful logon (even though I'm sure the credentials I'm supplying are valid). I've tested the control from Visual Foxpro on the same machine as our test Oracle 8i server and do not have the same problem. Since the object instantiates properly, and the method call returns a valid (though incorrect) result, I suspect that there might be an issue with conversion of the parameters from PL/SQL types to VB types. The object is written in MS Visual C++, as far as I know.
Can anyone shed some light on the situation? I can post my PL/SQL code if need be.
Thank you in advance,
null

Invoking a C# Component from a trigger

Hi,
I am interested in finding out if it is possible to access a C# object from within a trigger. I have a number of tables that contain fairly static information that I want to cache in a DataSet on the client machine to minimize the number of connections and database round trips. However, I need to know if the information in the table changes. I've got a basic CachedTable component working using the dbms_alert package (signal, register, waitone) but this requires an open connection to invoke the dbms_alert.waitone procedure to catch the signal (generated in a (IUD) trigger).
If I could invoke a C# method from the trigger then I could come up with some message based way to notify the client objects of the change in the table.
Thanks in advance,
Mike 
COM Automation is another product from Oracle that provides the option of a call out from Oracle database. There are two primary ways to tackle your problem,
1. Implement a COM wrapper around a .NET component and call this wrapper from the database trigger. See MSDN,
.NET Development -> Building Distributed Applications with .NET -> Architectural Topics -> Microsoft .NET/COM Migration and Interoperability
2. Use external procedures to call out to a DLL written in C, and invoke the .NET component from the DLL.
With the External DLL call method you mention I notice that there is a long pause before any data is returned (obviously whilst the server loads the DLL).
Is there any way of forcing the server to keep the DLL loaded to prevent this delay in getting data from the DLL's functions?

Categories

Resources