From d56ca5b841516b62c7d9af58b7ab3d32d79fe95b Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Sun, 27 Aug 2023 20:29:05 +1200 Subject: [PATCH] Deprecate for removal Database.commitTransaction() and Database.rollbackTransaction() Migrate to using try-with-resources and transaction.commit() and transaction.rollback() --- ebean-api/src/main/java/io/ebean/DB.java | 6 ++++++ ebean-api/src/main/java/io/ebean/Database.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ebean-api/src/main/java/io/ebean/DB.java b/ebean-api/src/main/java/io/ebean/DB.java index f20bcb740..b2490232b 100644 --- a/ebean-api/src/main/java/io/ebean/DB.java +++ b/ebean-api/src/main/java/io/ebean/DB.java @@ -267,15 +267,21 @@ public final class DB { } /** + * Deprecated for removal migrate using try-with-resources and commit on the transaction itself. + *

* Commit the current transaction. */ + @Deprecated(forRemoval = true) public static void commitTransaction() { getDefault().commitTransaction(); } /** + * Deprecated for removal migrate to using try-with-resources and rollback on the transaction itself. + *

* Rollback the current transaction. */ + @Deprecated(forRemoval = true) public static void rollbackTransaction() { getDefault().rollbackTransaction(); } diff --git a/ebean-api/src/main/java/io/ebean/Database.java b/ebean-api/src/main/java/io/ebean/Database.java index 21fb37d05..7c394c396 100644 --- a/ebean-api/src/main/java/io/ebean/Database.java +++ b/ebean-api/src/main/java/io/ebean/Database.java @@ -650,13 +650,19 @@ public interface Database { void flush(); /** + * Deprecated for removal migrate using try-with-resources and commit on the transaction itself. + *

* Commit the current transaction. */ + @Deprecated(forRemoval = true) void commitTransaction(); /** + * Deprecated for removal migrate to using try-with-resources and rollback on the transaction itself. + *

* Rollback the current transaction. */ + @Deprecated(forRemoval = true) void rollbackTransaction(); /**