Oracle® Objects for OLE Developer's Guide 10g Release 1 (10.1) Part Number B10118-01 |
|
See Also |
Properties |
Methods |
OraServer represents a physical network connection to an Oracle database server.
Remarks
The OraServer interface is introduced to expose the connection multiplexing feature provided in the Oracle Call Interface. After an OraServer object is created, multiple user sessions (OraDatabase) can be attached to it by invoking the OpenDatabase method. This feature is particularly useful for application components, such as Internet Information Server (IIS), that use Oracle Objects for OLE in an n-tier distributed environments. The use of connection multiplexing when accessing Oracle severs with a large number of user sessions active can help reduce server processing and resource requirements while improving the server scalability.
As illustrated in the following figure, the OraServer interface contains a connection to an Oracle server and provides a method (OpenDatabase) for creating user sessions (OraDatabases) on the server connection it contains.
Text description of the illustration o4o00015.gif
In the following Visual Basic example, two user sessions (hrDBSession1, hrDBSession2) are established on the server whose network alias is hrdb
.
'Main thread of execution. Create a server connection
Set hrDBServer = CreateObject("OracleInProcServer.XOraServer")
hrDBServer.Open ("hrdb")
Set hrDBSession1 = hrDBServer.OpenDatabase("scott/tiger",0)
'execute queries ...
Set hrDBSession2= hrDBServer.OpenDatabase("scott/tiger", 0)
'execute queries ...
This interface can also be created independently through the COM method, CreateObject in VBA, or CoCreateInstance in C/C++. In this case, the connection to the server must be established explicitly by invoking the Open method.
Set strprdServer = CreateObject(OracleInProcServer.XOraServer)
strprdServer.Open("strprd")