Simplify if statements and replace try-finally with try-with-resources
Closes gh-23445
This commit is contained in:
committed by
Sam Brannen
parent
fabdb07e53
commit
849bbf00b5
@@ -408,13 +408,9 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
|
||||
throws SQLException {
|
||||
|
||||
if (isEnforceReadOnly() && definition.isReadOnly()) {
|
||||
Statement stmt = con.createStatement();
|
||||
try {
|
||||
try (Statement stmt = con.createStatement()) {
|
||||
stmt.executeUpdate("SET TRANSACTION READ ONLY");
|
||||
}
|
||||
finally {
|
||||
stmt.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user