Skip to content

Commit 2bb4df7

Browse files
committed
Ignore SQLServerException with "not supported" message
Closes gh-34233
1 parent 36fd82f commit 2bb4df7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/JdbcTransactionObjectSupport.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-2025 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.
@@ -183,6 +183,13 @@ public void releaseSavepoint(Object savepoint) throws TransactionException {
183183
catch (SQLFeatureNotSupportedException ex) {
184184
// typically on Oracle - ignore
185185
}
186+
catch (SQLException ex) {
187+
// ignore Microsoft SQLServerException: This operation is not supported.
188+
String msg = ex.getMessage();
189+
if (msg == null || !msg.contains("not supported")) {
190+
throw new TransactionSystemException("Could not explicitly release JDBC savepoint", ex);
191+
}
192+
}
186193
catch (Throwable ex) {
187194
throw new TransactionSystemException("Could not explicitly release JDBC savepoint", ex);
188195
}

0 commit comments

Comments
 (0)