Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Developer's Guide

- Previous: General Steps for Creating a JDBC Resource
- Next: Obtaining a Physical Connection from a Wrapped Connection

## Sharing Connections

When multiple connections acquired by an application use the same JDBC resource, the connection pool provides connection sharing within the same transaction scope. For example, suppose Bean A starts a transaction and obtains a connection, then calls a method in Bean B. If Bean B acquires a connection to the same JDBC resource with the same sign-on information, and if Bean A completes the transaction, the connection can be shared.

Connections obtained through a resource are shared only if the resource reference declared by the J2EE component allows it to be shareable. This is specified in a component’s deployment descriptor by setting the `res-sharing-scope` element to `Shareable` for the particular resource reference. To turn off connection sharing, set `res-sharing-scope` to `Unshareable`.

For general information about connections and JDBC URLs, see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Administration Guide.

- Previous: General Steps for Creating a JDBC Resource
- Next: Obtaining a Physical Connection from a Wrapped Connection

- © 2010, Oracle Corporation and/or its affiliates