Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Q regarding OCI 8.x handles

Q regarding OCI 8.x handles

From: Billy Shields <random_at_opera.iinet.net.au>
Date: 27 Apr 1999 10:15:37 GMT
Message-ID: <7g42o9$j23$1@news.iinet.net.au>


I've been reading through the OCI Programmer's Guide (8.x) and I have basically figured out the general flow of events though I am somewhat confused by some issues regarding handles. Plus the documentation (seemingly) contradicts itself.

The OCI Programmer's Guide, in Chapter One states, in the section titled "A Connection Example" under "Understanding Multiple Connections and Handles":

"Q1. How many server handles are required?

"A1. Even though DB1 and DB2 reside on the same machine, 2 server
handles are required. Each server handle represents a database connection, and is identified by its own connect string."

The example they are using refers to user1 attaching to DB1 concurrently doing statement STMT1 in transaction TX1 and statement STMT2 in transaction TX2. User2 attaches to DB2 and concurrently does statement STMT3 in transaction TX3 and statement STMT4 in transaction TX4.

There are 2 databases involved so 2 server handles makes sense.

It goes on to ask:

"Q2. How many service context handles are required?

"A2. Four service context handles are required. Each user is
executing two transactions simultaneously, so each requires its own service context..."

What exactly is a service context handle? If you need one per transaction then how does it differ from a transaction handle?

Question 3 basically states that you need a user session handle per concurrent transaction so how does it differ from either the service context or transaction handles?

But the contradiction comes in question 6:

"Q6. If a single user in a single environment wants to execute four
different statements on 4 transactions concurrently against the same database, how many server handles are required?

"A6. Four server handles are required; one for each concurrent
transactions. There can be at most a single outstanding call on any server handle at a time."

This seems to contract the first question.

I need some clarification on what each of these handles means and when I need to use them before I feel comfortable programming with this. Can somebody please clear this up for me?

Also, what happens when you (say) try to use the same service context handle for two transactions/statements? Does Oracle spit one of its 25,000 errors or does it merely produce undefined behaviour?

Thanks in advance.

Regards
Billy Received on Tue Apr 27 1999 - 05:15:37 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US