!--a11y-->
Sharing Connections 
The connection handling mechanism in the SAP J2EE Engine enables the sharing of a single physical connection between multiple users – that is, it supports multiple connection handles associated to a single ManagedConnection. This feature is implemented for optimization purposes and is especially useful when the back end system allows for establishing a limited number of connections.
Connection sharing is only possible for transactional resources, which are used in distributed transactions. In addition, resources cannot be shared in system threads.
To use sharing, you must make sure that:
· The connection is provided by a connection factory with either LocalTransaction or XATransaction support.
· The resource reference is not declared non-transactional. For more information, see Connection Handling in Distributed and Local Transactions.
To enable connection sharing, you must set the sharing scope parameter for the resource in the deployment descriptor of the relevant application component that uses the connection.
The sharing scope of a resource is either Shareable or Unshareable.
The following example is a part of the deployment descriptor of an enterprise bean. It defines a shareable resource.

<resource-ref>
<res-ref-name>jdbc/CAR_RENTAL_POOL</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
