GeezerVison is showing github.com — Resource-based PlatformTransactionManager implementations defensively… · candrews/spring-framework@2e4eb9f
File treeExpand file treeCollapse file tree Open diff view settings spring-jdbc/src/main/java/org/springframework/jdbc/datasource spring-jms/src/main/java/org/springframework/jms/connection spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4 spring-orm/src/main/java/org/springframework/orm spring-tx/src/main/java/org/springframework/jca/cci/connection
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -238,7 +238,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) { | 238 | 238 | } | 239 | 239 | } | 240 | 240 |
| 241 | | - catch (Exception ex) { | | 241 | + catch (Throwable ex) { | 242 | 242 | DataSourceUtils.releaseConnection(con, this.dataSource); | 243 | 243 | throw new CannotCreateTransactionException("Could not open JDBC Connection for transaction", ex); | 244 | 244 | } | |
Collapse file Copy file name to clipboardExpand all lines: spring-jms/src/main/java/org/springframework/jms/connection/JmsTransactionManager.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - * Copyright 2002-2012 the original author or authors. | | 2 | + * Copyright 2002-2013 the original author or authors. | 3 | 3 | * | 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 5 | 5 | * you may not use this file except in compliance with the License. | @@ -196,7 +196,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) { | 196 | 196 | TransactionSynchronizationManager.bindResource( | 197 | 197 | getConnectionFactory(), txObject.getResourceHolder()); | 198 | 198 | } | 199 | | - catch (JMSException ex) { | | 199 | + catch (Throwable ex) { | 200 | 200 | if (con != null) { | 201 | 201 | try { | 202 | 202 | con.close(); | |
Collapse file Copy file name to clipboardExpand all lines: spring-orm-hibernate4/src/main/java/org/springframework/orm/hibernate4/HibernateTransactionManager.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -500,7 +500,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) { | 500 | 500 | txObject.getSessionHolder().setSynchronizedWithTransaction(true); | 501 | 501 | } | 502 | 502 |
| 503 | | - catch (Exception ex) { | | 503 | + catch (Throwable ex) { | 504 | 504 | if (txObject.isNewSession()) { | 505 | 505 | try { | 506 | 506 | if (session.getTransaction().isActive()) { | |
Collapse file Copy file name to clipboardExpand all lines: spring-orm/src/main/java/org/springframework/orm/hibernate3/HibernateTransactionManager.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -583,7 +583,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) { | 583 | 583 | txObject.getSessionHolder().setSynchronizedWithTransaction(true); | 584 | 584 | } | 585 | 585 |
| 586 | | - catch (Exception ex) { | | 586 | + catch (Throwable ex) { | 587 | 587 | if (txObject.isNewSession()) { | 588 | 588 | try { | 589 | 589 | if (session.getTransaction().isActive()) { | |
Collapse file Copy file name to clipboardExpand all lines: spring-orm/src/main/java/org/springframework/orm/jdo/JdoTransactionManager.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -366,7 +366,7 @@ public int getTimeout() { | 366 | 366 | closePersistenceManagerAfterFailedBegin(txObject); | 367 | 367 | throw ex; | 368 | 368 | } | 369 | | - catch (Exception ex) { | | 369 | + catch (Throwable ex) { | 370 | 370 | closePersistenceManagerAfterFailedBegin(txObject); | 371 | 371 | throw new CannotCreateTransactionException("Could not open JDO PersistenceManager for transaction", ex); | 372 | 372 | } | |
Collapse file Copy file name to clipboardExpand all lines: spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -425,7 +425,7 @@ public int getTimeout() { | 425 | 425 | closeEntityManagerAfterFailedBegin(txObject); | 426 | 426 | throw ex; | 427 | 427 | } | 428 | | - catch (Exception ex) { | | 428 | + catch (Throwable ex) { | 429 | 429 | closeEntityManagerAfterFailedBegin(txObject); | 430 | 430 | throw new CannotCreateTransactionException("Could not open JPA EntityManager for transaction", ex); | 431 | 431 | } | |
Collapse file Copy file name to clipboardExpand all lines: spring-tx/src/main/java/org/springframework/jca/cci/connection/CciLocalTransactionManager.java +3-4Lines changed: 3 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | /* | 2 | | - * Copyright 2002-2012 the original author or authors. | | 2 | + * Copyright 2002-2013 the original author or authors. | 3 | 3 | * | 4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 5 | 5 | * you may not use this file except in compliance with the License. | | 29 | 29 | import org.springframework.transaction.TransactionSystemException; | 30 | 30 | import org.springframework.transaction.support.AbstractPlatformTransactionManager; | 31 | 31 | import org.springframework.transaction.support.DefaultTransactionStatus; | 32 | | -import org.springframework.transaction.support.TransactionSynchronizationManager; | 33 | 32 | import org.springframework.transaction.support.ResourceTransactionManager; | | 33 | +import org.springframework.transaction.support.TransactionSynchronizationManager; | 34 | 34 |
| 35 | 35 | /** | 36 | 36 | * {@link org.springframework.transaction.PlatformTransactionManager} implementation | @@ -141,7 +141,6 @@ protected boolean isExistingTransaction(Object transaction) { | 141 | 141 | @Override | 142 | 142 | protected void doBegin(Object transaction, TransactionDefinition definition) { | 143 | 143 | CciLocalTransactionObject txObject = (CciLocalTransactionObject) transaction; | 144 | | - | 145 | 144 | Connection con = null; | 146 | 145 |
| 147 | 146 | try { | @@ -169,7 +168,7 @@ protected void doBegin(Object transaction, TransactionDefinition definition) { | 169 | 168 | ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory()); | 170 | 169 | throw new CannotCreateTransactionException("Could not begin local CCI transaction", ex); | 171 | 170 | } | 172 | | - catch (ResourceException ex) { | | 171 | + catch (Throwable ex) { | 173 | 172 | ConnectionFactoryUtils.releaseConnection(con, getConnectionFactory()); | 174 | 173 | throw new TransactionSystemException("Unexpected failure on begin of CCI local transaction", ex); | 175 | 174 | } | |
|