Skip to main content

Connection sharing in JCA glassfish

1 reply [Last post]
Joined: 2010-12-16

down vote favorite

I have a misunderstanding regarding the connection handle sharing in JCA.

I want to know if the connection sharing only happens during a phase of transaction ( multiple components call ) or the connection sharing is possible amongst multiple clients accessing a component that has the same EIS destination.

I created my own resource adapter on Glassfish application server 3.1. The problem is the resource adapter doesn't perform any connection sharing (no associateConnection method call).


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2012-04-25

Connection sharing only happens in a transaction scope, either local or XA. Below is the detailed conditions of connection sharing.

When multiple shareable connections x and y acquired by an application are used within a global transaction scope (for instance, container-managed or bean-managed), the application server must provide a single shared connection behavior under the following conditions:
■ x and y are collocated in a single Java Virtual Machine process address space.
■ x and y are using a single transactional resource manager.
■ x and y have identical properties.
■ x and y are marked as shareable.
■ x and y are used within a container-managed or bean-managed transaction scope.