Skip Headers
Oracle® COM Automation Feature Developer's Guide
10g Release 2 (10.2)

Part Number B14310-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Feedback

Go to previous page
Previous
Go to next page
Next
View PDF

1 Introducing Oracle COM Automation Feature

Beta Draft

This chapter describes the Oracle COM Automation Feature Software Development Kit (SDK) and provides an overview of the product. Read this chapter before installing or using Oracle COM Automation Feature.

This chapter contains these topics:

Introduction to Oracle COM Automation Feature

Oracle COM Automation Feature enables you to use Component Object Model (COM)-based components to customize and enhance the functionality of the Oracle database on Windows operating systems.

You can build your own custom components or use the thousands of pre-built components that are available from third-party independent software vendors (ISVs).

Oracle COM Automation Feature Functionality

Oracle COM Automation Feature provides a mechanism to manipulate COM objects through either PL/SQL or Java. The feature acts as a generic wrapper around the IDispatch interface.

  • The feature externalizes all the methods supported by the IDispatch interface.

  • COM objects expose properties, data attributes, and methods (functions that perform an action) to the developer.

  • The IDispatch interface supports three basic operations for any COM object:

    • Gets the value of an exposed property

    • Sets the value of an exposed property

    • Invokes a method on an object

When an Oracle COM Automation Feature API is invoked from PL/SQL or Java Stored Procedures, the feature converts the parameters to the appropriate COM Automation datatypes and then invokes the corresponding IDispatch API with the converted parameters.


See Also:

Chapter 3, "Oracle COM Automation Feature Core Functionality" for descriptions of the datatypes and APIs

Oracle COM Automation Feature for PL/SQL

Oracle COM Automation Feature for PL/SQL provides a PL/SQL package and exposes a set of application programming interfaces (APIs) to instantiate COM objects. Developers can call these APIs from PL/SQL subprograms, stored procedures, stored functions, or triggers to manipulate COM objects.

There are no restrictions concerning where these COM objects reside. They can be local to the database or accessed remotely through the Distributed Component Object Model (DCOM).

Oracle COM Automation Feature for Java

Oracle COM Automation Feature for Java provides a set of Java APIs to instantiate COM objects. Developers can call these APIs from Java stored procedures, Java functions, or Java triggers to manipulate COM objects.

Oracle COM Automation Feature for Java does not allow in-process COM Automation servers. Developers can use dllhost to support in-process servers.

Benefits of Oracle COM Automation Feature

Oracle COM Automation Feature is a powerful and enabling infrastructure technology for Oracle developers on Windows. It provides these compelling benefits:

Oracle COM Automation Feature Architecture

Figure 1-1, "Oracle COM Interaction" illustrates the interaction between an Oracle9i database with Oracle COM Automation Feature, client applications, and server applications.

Figure 1-1 Oracle COM Interaction

Description of comdg001.gif follows
Description of the illustration comdg001.gif

The architectural differences between Oracle COM Automation Feature for PL/SQL and for Java are described in the next two sections.

PL/SQL Architecture

Oracle COM Automation Feature for PL/SQL provides a package of PL/SQL APIs for manipulating COM objects. These APIs are implemented as external procedures in a Dynamic Link Library (DLL).

Oracle9i supports external procedures that enable developers to call Third Generation Language (3GL) functions from server-based object type methods and stored procedures. External procedures are invoked exactly like standard PL/SQL stored procedures. However, unlike standard PL/SQL procedures where the body of the procedure is written in PL/SQL and stored in the database, external procedures are functions in the C programming language that reside within a DLL. You can invoke Oracle COM Automation Feature APIs in the same manner in which you call a standard PL/SQL stored procedure or function.

Figure 1-2, "COM Automation Feature Architecture for PL/SQL" shows an Oracle9i database invoking COM Automation external procedure APIs.

Figure 1-2 COM Automation Feature Architecture for PL/SQL

Description of comdg002.gif follows
Description of the illustration comdg002.gif

Invoking COM Automation External Procedure APIs

The database server invokes any of the COM Automation external procedure APIs as follows:

  1. The PL/SQL interpreter looks up the path name to the Oracle COM Automation Feature DLL (orawpcomVER.dll) where VER is the release version.

  2. The PL/SQL interpreter sends a message to the listener using Oracle Net to start extproc.exe, if it has not already been started for the current user session.

  3. The PL/SQL interpreter passes the procedure name, the parameters, and the path name of the DLL to extproc.exe.

  4. The extproc.exe file loads the DLL and executes the external procedure. Each of the COM Automation external procedure APIs in turn call Win32 APIs that instantiate a COM object, set or get properties of a COM object, or invoke a method of a COM object.

  5. The extproc.exe file acts as an intermediary and handles any interaction between Oracle COM Automation Feature and the database server.

Architectural Impact on Availability Issues

The dependence on external procedures by Oracle COM Automation Feature for PL/SQL has implications for the availability of the database server.

You do not jeopardize the availability of the database server by using Oracle COM Automation Feature and custom or third-party COM objects in a production environment. Oracle COM Automation Feature operates outside of the Oracle kernel's address space. This safeguards the Oracle database from COM objects that crash unexpectedly.

Java Architecture

Oracle COM Automation Feature for Java is implemented by the Java Native Interface (JNI) as shown in Figure 1-3, "COM Automation Feature Architecture for Java".

The key components of this architecture are the Automation class and the Java COM Proxy DLL, orawcomVER.dll, where VER is the release version.

The interface is the Automation class, a Java proxy to COM Automation server. The Automation class provides the methods necessary for developers to manipulate COM objects through the IDispatch interface.

The Java-specific COM proxy, orawcomVER.dll, enables Java functions to invoke their corresponding COM functions.

Figure 1-3 COM Automation Feature Architecture for Java

Description of comdg003.gif follows
Description of the illustration comdg003.gif

Reliability

Oracle COM Automation Feature for Java invokes COM components from the database server. However, these COM components are run outside of the Oracle9i database process. This design prevents unstable COM components from interfering with the database process.