diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/JdbcTransactionObjectSupport.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/JdbcTransactionObjectSupport.java index 49421e52fcf..aaa09e3a691 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/JdbcTransactionObjectSupport.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/JdbcTransactionObjectSupport.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -183,6 +183,13 @@ public abstract class JdbcTransactionObjectSupport implements SavepointManager, catch (SQLFeatureNotSupportedException ex) { // typically on Oracle - ignore } + catch (SQLException ex) { + // ignore Microsoft SQLServerException: This operation is not supported. + String msg = ex.getMessage(); + if (msg == null || !msg.contains("not supported")) { + throw new TransactionSystemException("Could not explicitly release JDBC savepoint", ex); + } + } catch (Throwable ex) { throw new TransactionSystemException("Could not explicitly release JDBC savepoint", ex); }