#1245 - Refactor internals - move logic to TransactionManager from DefaultServer

This commit is contained in:
Rob Bygrave
2018-01-31 13:36:23 +13:00
parent f9cd955f7a
commit a92e620f7e
2 changed files with 11 additions and 14 deletions
@@ -552,12 +552,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
*/
@Override
public void externalModification(TransactionEventTable tableEvent) {
SpiTransaction t = transactionManager.get();
if (t != null) {
t.getEvent().add(tableEvent);
} else {
transactionManager.externalModification(tableEvent);
}
transactionManager.externalModification(tableEvent);
}
/**
@@ -417,14 +417,16 @@ public class TransactionManager implements SpiTransactionManager {
}
}
/**
* Process a Transaction that comes from another framework or local code.
* <p>
* For cases where raw SQL/JDBC or other frameworks are used this can
* invalidate the appropriate parts of the cache.
* </p>
*/
public void externalModification(TransactionEventTable tableEvents) {
public void externalModification(TransactionEventTable tableEvent) {
SpiTransaction t = get();
if (t != null) {
t.getEvent().add(tableEvent);
} else {
externalModificationEvent(tableEvent);
}
}
private void externalModificationEvent(TransactionEventTable tableEvents) {
TransactionEvent event = new TransactionEvent();
event.add(tableEvents);