Issue Details (XML | Word | Printable)

Key: JDBC-131
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Critical Critical
Assignee: Mark Rotteveel
Reporter: Torsten Strasser
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Jaybird JCA/JDBC Driver

Problems using XA Driver in AppServer when looking up a Connection (like JDBC-86)

Created: 30/Dec/08 07:39 PM   Updated: 18/Aug/12 07:31 AM
Component/s: JCA layer, JDBC driver
Affects Version/s: Jaybird 2.1.6
Fix Version/s: Jaybird 2.2

Environment: Windows Vista 64bit, java 1.6_11, glassfish 9
Issue Links:

 Description  « Hide
When getting a connection from a XA datasource retrieved via a JNDI lookup within an ejb, exceptions like in JDBC-86 occure. The solution is to
not close the connection (i. e. in a finally block) after finishing the operations. In my opinion, in a managed environment like in an
appsever where connection pooling is used, the close-operation should do nothing and it should definitly not cause an exception.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Roman Rokytskyy added a comment - 31/Dec/08 02:12 PM
Can you describe your configuration? I.e. how did you configure the Glassfish, etc. In general it should be possible to close the connection in a finally block, and in this case connection will be returned back to the pool...

Torsten Strasser added a comment - 08/Jan/09 10:11 PM
I deployed a connection pool with the following settings:

Datasource classname: org.firebirdsql.pool.sun.AppServerXADataSource
Resource Type: javax.sql.XADataSource

Pool-size: 8 - 64

databaseName: //localhost:3050/C:\development\projects\stuff\xxxx.FDB
userName: SYSDBA
JDBC30DataSource: true
type: TYPE4
password: masterkey

The datasource is looked up by an POJO class via JNDI which lives inside an stateles EJB (in this case I don't use dependency injection).
Inside the class some SELECT-statements are executed and the connection is closed in a finally block.

This szenario gives the same errors like described in JDBC 86. When I remove the code for closing the connection, it runs without problems, but
I don't really feel good with this workaround because the same code is also used outside an JEE container.

It doesn't matter if I use the XA driver or the usual pooling driver. The only driver which works is the org.firebirdsql.pool.sun.AppServerDataSource.
That's why I assume, that the connection is not returned to the pool when it is closed.

When I use the resource adapter (I deployed the RAR into glassfish) and use it as a datasource with XA transactions, it also runs without

Mark Rotteveel added a comment - 10/Sep/11 03:56 PM
Resolved by JDBC-176 if you replace the current XADataSource with org.firebirdsql.ds.FBXADataSource. The implementations in org.firebirdsql.pool and org.firebirdsql.pool.sun won't be fixed and may be removed in Jaybird 2.3 or later.