Browse Source

Propagate JMS IllegalStateException from commit/rollbackIfNecessary

Closes gh-32473

(cherry picked from commit cd7ba1835c)
pull/32754/head
Juergen Hoeller 2 years ago
parent
commit
0628b479f1
  1. 6
      spring-jms/src/main/java/org/springframework/jms/support/JmsUtils.java

6
spring-jms/src/main/java/org/springframework/jms/support/JmsUtils.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2024 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -217,7 +217,7 @@ public abstract class JmsUtils {
try { try {
session.commit(); session.commit();
} }
catch (javax.jms.TransactionInProgressException | javax.jms.IllegalStateException ex) { catch (javax.jms.TransactionInProgressException ex) {
// Ignore -> can only happen in case of a JTA transaction. // Ignore -> can only happen in case of a JTA transaction.
} }
} }
@ -232,7 +232,7 @@ public abstract class JmsUtils {
try { try {
session.rollback(); session.rollback();
} }
catch (javax.jms.TransactionInProgressException | javax.jms.IllegalStateException ex) { catch (javax.jms.TransactionInProgressException ex) {
// Ignore -> can only happen in case of a JTA transaction. // Ignore -> can only happen in case of a JTA transaction.
} }
} }

Loading…
Cancel
Save