Ignore SQLServerException with "not supported" message

Closes gh-34233
This commit is contained in:
Juergen Hoeller 2025-01-12 18:08:54 +01:00
parent 36fd82f32f
commit 2bb4df79c3
1 changed files with 8 additions and 1 deletions

View File

@ -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);
}