diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/CleanTransaction.java b/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/CleanTransaction.java index cf3fad7ae..d0e16d41d 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/CleanTransaction.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/CleanTransaction.java @@ -83,9 +83,7 @@ public class CleanTransaction extends Transaction { .map(Map.Entry::getKey) .collect(Collectors.toList()); for (UUID uuid : inactivePlayers) { - // TODO Figure out a better way to schedule transactions from within transactions - // or figure out a way to execute the transaction within this transaction. - db.executeTransaction(new RemovePlayerTransaction(uuid)); + executeOther(new RemovePlayerTransaction(uuid)); } return inactivePlayers.size(); } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/Transaction.java b/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/Transaction.java index 176b4c296..8d8f01d3b 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/Transaction.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/access/transactions/Transaction.java @@ -146,6 +146,12 @@ public abstract class Transaction { } } + protected void executeOther(Transaction transaction) { + transaction.connection = this.connection; + transaction.performOperations(); + transaction.connection = null; + } + protected DBType getDBType() { return db.getType(); }