OW2 Forge: Detail: 306486 problems if no connections have been retrieved before transaction timed out

Advanced - Powered by Google

Log In
New Account
My Page
Project Tree
Project Openings

Tracker: Bugs

Submit New | Browse | Admin | ExportToXml

[ #306486 ] problems if no connections have been retrieved before transaction timed out

2006-12-06 15:41
Submitted By:
Michal Wroblewski (mwroblewski)
Assigned To:
Philippe Durieux (durieuxp)
problems if no connections have been retrieved before transaction timed out

Detailed description:
If a JTA transaction times out before any connections are retrieved, subsequent DataSource.getConnection() operations retrieve each time new physical connection that works in auto-commit mode and is not returned to the pool after close() . Moreover, SQL statements executed on these connections are not rolled back although transaction times out. Possible cause is in TransactionImpl code: public void timeoutExpired(Object arg) { if (TraceTm.jta.isDebugEnabled()) { TraceTm.jta.debug("TransactionImpl.timeoutExpired"); } // increment counter for management Current.getCurrent().incrementExpiredCounter(); // make the subcoordinator object, if not existing yet. if (subcoord == null) { // if this is a proxy, just forget this object. The JTM will // rollback transaction with its own timer. Terminator term = myCtx.getTerminator(); if (term != null) {"forget tx (tx=" + this +")"); Current.getCurrent().forgetTx(getXid()); return; } makeSubCoord(); } // Try to set it "rollback only" // avoids a rollback while SQL requests are in progress"set rollback only (tx=" + this +")"); try { subcoord.setRollbackOnly(); } catch (Exception e) { TraceTm.jotm.error("cannot rollbackonly:" + e); return; } } If subcoord is null (which as it seems happens if no connection has been retrieved yet - see attachecd logs for first database operation), transaction timeout may disassociate it from current thread. This may be also a JONAS bug concerning data source ?? Attached JSP file waits for transaction timeout, then attempts to execute 50 "update test set counter = counter + 1" SQL queries. First 30 (ie. size of the pool) operations succeed, next 20 do not as used connections are not returned to the pool and getConnection() operations are rejected. If code before Thread.sleep(5000) is uncommented, only a single physical connection is retrieved which is returned to the pool each time and the transaction rolls back. Attached ZIP file contains: - webapp consisting of mentioned JSP file, - scripts to create / drop database for this webapp - JONAS configuration files for this webapp (configuration includes data source, shorter transaction timeout, JOTM debug and recovery) - JONAS logs (also for case when first DB operation is uncommented) Environment: JONAS 4_7_7 (shipped with JOTM_2_0_11) (also tried JONAS 4_7_6 and 4_5_3), PostgreSQL 8.1.2, postgresql-7.4.1-jdbc3 driver (also tried postgresql-8.1-408.jdbc3)

Add A Comment:

Please login


No Followups Have Been Posted

Attached Files:

Name Description Download
jotm_test.tar.gz example Download


Field Old Value Date By
artifact_group_idNone2009-03-10 16:35durieuxp
resolution_idNone2009-01-06 11:46durieuxp
category_idNone2009-01-06 11:46durieuxp
priority52009-01-06 11:46durieuxp
assigned_tonone2009-01-06 11:46durieuxp
File Added791: jotm_test.tar.gz2006-12-07 09:23mwroblewski

Copyright © 1999-2008, OW2 Consortium | contact | PS: You have a difficulty, a problem ? Please report an issue using your main OW2 account credentials