Skip to content

Commit cd7ba18

Browse files
committed
Propagate JMS IllegalStateException from commit/rollbackIfNecessary
Closes gh-32473
1 parent 5dc6a16 commit cd7ba18

File tree

1 file changed

+3
-3
lines changed
  • spring-jms/src/main/java/org/springframework/jms/support

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -217,7 +217,7 @@ public static void commitIfNecessary(Session session) throws JMSException {
217217
try {
218218
session.commit();
219219
}
220-
catch (jakarta.jms.TransactionInProgressException | jakarta.jms.IllegalStateException ex) {
220+
catch (jakarta.jms.TransactionInProgressException ex) {
221221
// Ignore -> can only happen in case of a JTA transaction.
222222
}
223223
}
@@ -232,7 +232,7 @@ public static void rollbackIfNecessary(Session session) throws JMSException {
232232
try {
233233
session.rollback();
234234
}
235-
catch (jakarta.jms.TransactionInProgressException | jakarta.jms.IllegalStateException ex) {
235+
catch (jakarta.jms.TransactionInProgressException ex) {
236236
// Ignore -> can only happen in case of a JTA transaction.
237237
}
238238
}

0 commit comments

Comments
 (0)