Alexandre Borgoltz wrote:
I am using oracle8i with 8i client jar. Using that -thin- 8i JDBC driver , the performance tests show there is a huge difference between
*recreating a connection each time - obviously ultimately slow
*using a single connection but re-preparing a PreparedStatement with the same query - better *using a single connection and a single PreparedStatement, only calling setXXX methods between calls to .executeQuery() - the best

Even though the OJB "Oracle" platform impl will not directly control any
Oracle JDBC-driver extensions, you can still control eg Oracle row
pre-fetching with the new JDBC attributes (again, this requires you
to check out from CVS or wait for 1.0.4).

See link [1] for the complete list of JDBC properties.

You can use the Oracle 10.1.0 JDBC-driver to access your Oracle 8i RDBMS,
if it is v8.1.7.
(A new driver can almost always talk to older servers,
see link [2] for a complete compatibility matrix.)

To set Oracle row-prefetch you add the following to your OJB connection-pool
configuration:
 <attribute
   attribute-name="jdbc.defaultRowPrefetch"
   attribute-value="(your choice here)"/>

Same warning applies for high Oracle row-prefetch as for a large DBCP
Statement pool - the JVM can quickly throw OutOfMemory exceptions if
you don't increase heap size with -Xmx.


All of these tweaks are highly application-dependent and you cannot
tell any generic "magic" values that will work well for all application
profiles. It is very dependent on wether you access large Collections
in serial order (use high row pre-fetch and OJB proxy-prefetch) or
mostly get smaller result sets in random order (turn off Oracle row-
prefetch and definately try to use OJB proxies for referenced objects
if you don't know for sure that you will access all references).

Running your OJB application for a while with IronTrack [3] attached
is a great way of monitoring the application profile a get hints
for new database indices and/or good OJB configuration settings.

Regards,
 Martin

[1] 
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_01
    (scroll down to "Connection Properties Recognized by Oracle 10.1.0 JDBC 
Drivers")
[2] 
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#02_02
[3] http://www.irongrid.com/irontracksql/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to