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

Home -> Community -> Usenet -> c.d.o.misc -> Oracle JDBC connection class (10.1 vs 10.2)

Oracle JDBC connection class (10.1 vs 10.2)

From: Thomas Olszewicki <ThomasO_at_cpas.com>
Date: Thu, 14 Jun 2007 08:14:57 -0700
Message-ID: <1181834097.243017.194850@j4g2000prf.googlegroups.com>


We have come across rather puzzling difference in JDBC documentation for JDBC Connection class in Oracle v 10.2 versus 10.1.

Totally different recommendations for sharing connection object between threads.

>From Oracle 10.2 JDBC Developer's Guide :
"The Oracle JDBC drivers provide full support for, and are highly optimized for,
 applications that use Java multithreading.  Controlled serial access to a connection, such as that provided by connection caching,
 is both necessary and encouraged.
 However, Oracle strongly discourages sharing a database connection among multiple threads.
 Avoid allowing multiple threads to access a connection simultaneously.
 If multiple threads must share a connection, use a disciplined begin- using/end-using protocol."
URL references:
 http://download-east.oracle.com/docs/cd/B19306_01/java.102/b14355/apxtips.htm#i1005436

Same fragment
>From Oracle 10.1 and before (9.x)

"The Oracle JDBC drivers provide full support for programs that use Java multithreading.
 The following example creates a specified number of threads and lets you determine
 whether or not the threads will share a connection.  If you choose to share the connection, then the same JDBC connection object
 will be used by all threads (each thread will have its own statement object, however).
 Because all Oracle JDBC API methods are synchronized,  if two threads try to use the connection object simultaneously,  then one will be forced to wait until the other one finishes its use."
URL references:
 http://download-east.oracle.com/docs/cd/B14117_01/java.101/b10979/tips.htm#sthref2139

Does it mean that Oracle took a giant step backward ?

At the same time Oracle claims there are no significant changes in JDBC driver
between version 10.2 and 10.1.

Tests provided with JDBC v 10.1 work the same way in 10.2.

Has anybody come across any other Oracle documentation describing this change or
any other related topic.

(We didn't find anything at Google or Oracle documentation, or we don't know what key words to search)

TIA Thomas Olszewicki
CPAS Systems Inc. Received on Thu Jun 14 2007 - 10:14:57 CDT

Original text of this message

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