36

Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

  • Upload
    eithne

  • View
    51

  • Download
    2

Embed Size (px)

DESCRIPTION

Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation. Oracle Database 10g JDBC Best-of-Breed Drivers for Java, J2EE, Web Services and GRID. Agenda. Oracle Database 10 g JDBC Overview Implicit Connection Cache Fast Connection Fail-Over. Agenda. - PowerPoint PPT Presentation

Citation preview

Page 1: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation
Page 2: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Kuassi MensahRajkumar IrudayarajJava Products GroupOracle Corporation

Page 3: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Oracle Database 10g JDBCBest-of-Breed Drivers for Java, J2EE, Web Services and GRID

Page 4: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Agenda

Oracle Database 10g JDBC Overview Implicit Connection Cache Fast Connection Fail-Over

Page 5: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Agenda

Oracle Database 10g JDBC Overview• Re-Architecture Groundwork• Database Connectivity for Java, J2EE, Web Services and

GRID • Tighter Integration with the Oracle Database• Feature Consistency across Type-2 and Type-4 Drivers• Miscellaneous Enhancements

Implicit Connection Cache Fast Connection Fail-Over

Page 6: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Re-Architecture Ground Work

Reduce functional gap between drivers Faster JDBC Application Execution

– Reduced Code Path– Reduced Java intermediate and Temporary

Objects– Caching and Reusing – Optimized Conversion Operations

Fastest JDBC Drivers, Best SPECJApp2002 results

Page 7: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Comprehensive Support for JDBC 3.0

Oracle Database 9i R2 JDBC– Transaction Savepoint– Toggling between Local and Global transactions– Reuse of PreparedStatement– JDK 1.4.x support for JDBC Clients

Oracle Database 10g JDBC– Named Parameters– DataLink URL – New Ref interface– J2EE Connector Architecture Resource Adapter– Web Rowset (JSR-114 Public Draft)

Page 8: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Database Connectivity for Web Services

Web Services Support– JDBC 3.0 Web RowSet (JSR-114 Public Draft)– Database Web Services Call-in

GRID Computing Support– Dynamic Load-balancing across RAC/GRID– Transparent Session Migration for GRID (Future)

Page 9: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

JSR-114 JDBC RowSet

JDBCRowSet

CachedRowSet

FilteredRowSet

WebRowSet

EJB Servlet

Web Services

Page 10: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

JDBC WebRowSet - Definition

An implementation of JSR-114, extends java.sql.ResultSet capabilities

– Enables reading and writing result sets from/into XML format– Serializable/Distributable– Disconnected, decoupled from Data Source – Extensible to non-tabular data– Can be shipped over Internet using HTTP/XML protocols

Page 11: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

JDBC WebRowSet - Example//create a resultSet to populate RowSet stmt = conn.createStatement(); rs = stmt.executeQuery("select ..."); OracleWebRowSet wrs = new OracleWebRowSet();

// populate the RowSet wrs.populate(rs); // close the connection conn.close(); // RowSet still contains values... wrs.next(); Object col1 = wrs.getObject(1); // write the RowSet out as XML wrs.writeXML(out);

Page 12: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Database as Web Services Provider

SOAP

J2EE(Business Logic)

Oracle9iASWebServicesFramework

Web Web ServiceServiceClientClient Data

Data Logic

AQ/Streams

SQL/QuerySQL/DML

JavaPL/SQLOracle Oracle ApplicationApplication

ServerServer1010gg

JDBC

OracleOracleDatabase 10Database 10gg

Page 13: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Database Connectivity forRAC/GRID

Dynamic Load-balancing across RAC/GRID– Fast Connection Fail-Over

Transparent Session Migration for GRID– Migrate Sessions across instances of the same

database (Future)

Page 14: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Tighter Integration with the Oracle Database

Manageability/Ease of Use– End-to-End Tracing support– Enhanced Datum support– Easy Type-2 Driver Install

New and Enhanced Data Types– Native IEEE DOUBLE and FLOAT– INTERVAL-DAY-TO-SECOND– Enhanced VARRY– LONG-to-LOB Conversion– Unlimited LOB size

Page 15: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Feature Consistency across Type-2 and Type-4 Drivers

“Thin” Reducing the gap with “OCI” – PL/SQL Index-By table support– New Encryption algorithms: 3DES112 &

3DES168– Direct XA: performance optimizations for XA

operations – Proxy Authentication– RAC/HA support: Fast Connection Fail-Over– Starting/Stopping the Database

Page 16: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Miscellaneous

System Properties to set CHAR/NCHAR behavior

Stop shipping classes111 and zip files NLS Repackaging

Page 17: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Agenda

• Oracle Database 10g JDBC Overview Implicit Connection Cache

• Connection Caching: 9i R2 versus 10g• Transparent Access to the Cache• Connection Retrieval based on User-Defined

Attributes• Handling Abandoned Connections• Connection Cache Manager• Advanced Features

Fast Connection Fail-Over

Page 18: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Connection Caching: 9i R2 versus 10g Connection

Connection Caching 9i R2 10g

Transparent Cache Access No Yes

Refresh Stale Connections No Yes

Attributes based Conn. Retrieval No Yes

Reclaim/Reuse Abandoned Conn. No Yes

Heterogeneous User/Password No Yes

Centralized Cache Management No Yes

Connection Caching 9i R2 10g

Transparent Cache Access No Yes

Refresh Stale Connections No Yes

Attributes based Conn. Retrieval No Yes

Reclaim/Reuse Abandoned Conn. No Yes

Heterogeneous User/Password No Yes

Centralized Cache Management No Yes

Page 19: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Transparent Access to the Connection Cache

Standard DataSource getConnection() APIs retrieve cached Connections

Example:ods.setUSer(“scott”);ods.setConnectionCachingEnabled(true);ctx.bind(“MyDS”, ods);…ds = (OracleDataSource) ctx.lookup(“MyDS”);conn.getConnection(); // transparent cache creation and access …conn.close(); // return connection to the cache…ds.close(); // finally, close cache enabled DataSource

Page 20: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Connection Attributes Support

Request connection from cache based on user-defined attributes

– getConnection(java.util.Properties connAttr) Support to associate user-defined attributes on a

connection for future retrieval– applyConnectionAttributes(java.util.Properties

connAttr)– close(java.util.Properties connAttr)

Get unmatched attributes on the retrieved connection – java.util.Properties

getUnMatchedConnectionAttributes()

Page 21: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Connection Attributes Support…

Example:// Multiple attributes may be specifiedconnAttr.setProperty(“NLS_LANG”, “ISO-LATIN-1”);connAttr.setProperty(“TRANSACTION_ISOLATION”, “SERIALIZABLE”);…conn = getConnection(connAttr); // retrieve connection…// get UnMatched attributes from the retrieved connection// May need to initialize the required attributes that did not matchjava.util.Properties unMatchedAttr =

conn.getUnMatchedConnectionAttributes();

…conn.close(connAttr); // close the connection

Page 22: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Abandoned Connection Timeout Support

Helps reclaim abandoned or orphaned connections checked out from the cache

Support enabled by setting AbandonedConnectionTimeout property on the cache

JDBC monitors heart beat based on activity to the database, such as stmt.execute().

Connection is reclaimed and returned to the cache, if connection is inactive for the specified period

Page 23: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Connection Cache Manager

Cache Manager

Oracle JDBC Driver

...

Session 1.1

Session n.1

....

Cache# 1

Session 1.m

....Cache# nSession n.m

mid-tier Node

Page 24: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Connection Cache Manager…

Centralized Connection Cache Management Handles cache management from creation

until death. Allows dynamic cache reconfiguration. Supports retrieval of number of checked out

or available connections Supports and manages multiple caches

Page 25: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Advanced Features

Connection Attributes support based on weights – Allows assignment of weights to attributes for

selective retrieval of connections from cache.

Support for new Cache property– to assign weights to connection Attributes:

java.util.Properties CacheAttributeWeights

Support for Connection Cache Callbacks – for AbandonedConnectionCallback and

ReleaseConnectionCallback

Page 26: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Agenda

• Oracle Database 10g JDBC Overview• Implicit Connection Caching Fast Connection Fail-Over

Page 27: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fast Connection Fail-over– Resilient connections – Rapid detection and

cleanup of invalid connections in the cache– This is achieved by handling RAC Service/Host

DOWN events– Load Balancing of connections for Service UP

events

Failed Database Connections New Database Connections

Fast Connection Failover

Page 28: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fail-over Scenario

Pre Fail-over

Post Fail-Over

Instance#1

ERP Java/J2EE

Inst 1 Inst 2 Inst 3 Inst 4

Page 29: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fast Connection Fail-over Processing

ONS Daemon

Failover Event HandlerThread

Su

bsc

rib

e

Pu

blis

h

Connection Cache Manager

Start/StopConnection

cache objects

......Connection

objects

Threads process events, one per cache

2

1

34

5handleEvent()

Page 30: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fast Connection Fail-over Processing…

New DataSource property: ConnectionFailoverEnabled must be set to true

Works in conjunction with Implicit Connection Caching, to process connections efficiently

Each connection is mapped to its Instance Name and Host Name.

Processes Service UP/DOWN and Host DOWN events.

Process events one at a time – guaranteed processing.

Page 31: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fast Connection Fail-over Processing…

One Worker thread per Connection Cache handles event processing – more efficient

First pass – Connections are marked as down first, to efficiently disable bad

connections

Second pass – Cleans up connections that are marked as bad

Applications in the middle of a Transaction are thrown a SQL Exception, and the Transaction is rolled back

Service UP event initiates connections to be Load Balanced to all active RAC instances

Page 32: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

Fast Connection Fail-over (FCF) vs. TAF Connection Retries:

- FCF allows retry at the Application level, whereas TAF retries occur at the OCI/Net layer. Application layer (Example: EJB Container) fully controls retries

Integrated with the Connection Cache:- Unlike TAF, FCF works in conjunction with the Implicit

Connection Cache, and has complete control over connections managed by the cache

RAC Events Based:- FCF is a RAC event based mechanism. This is much more

efficient than detecting failures of network calls Load Balancing Support:

- FCF supports UP event Load Balancing of connections across active RAC instances

Page 33: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

JDBC Summary Best performing JDBC drivers Hassle-Free Install and Upgrade Faster Development

– Best Database Connectivity for Java, J2EE, Web Services and GRID

Tighter Integration with the Oracle Database Feature Rich Implicit Connection Cache RAC Events based Fast Connection Fail-Over Feature consistency across type-2 and type-4 JDBC

drivers – Allows the flexibility of using different flavor of JDBC

drivers for development and deployment

Page 34: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

More on TheServerSide.com J2EE Community

News Articles Design Patterns Benchmarks Case Studies Free PDFs of popular books

Page 35: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation

AQ&Q U E S T I O N SQ U E S T I O N S

A N S W E R SA N S W E R S

Page 36: Kuassi Mensah Rajkumar Irudayaraj Java Products Group Oracle Corporation