diff --git a/modules/minigl/src/main/java/org/jpos/gl/GLSession.java b/modules/minigl/src/main/java/org/jpos/gl/GLSession.java index 04700cbeea..368cff719e 100644 --- a/modules/minigl/src/main/java/org/jpos/gl/GLSession.java +++ b/modules/minigl/src/main/java/org/jpos/gl/GLSession.java @@ -46,6 +46,7 @@ public class GLSession { public static final BigDecimal ZERO = new BigDecimal ("0.00"); public static final BigDecimal Z = new BigDecimal ("0"); private long SAFE_WINDOW = 1000L; + private boolean ignoreBalanceCache = false; /** * Construct a GLSession for a given user. @@ -1067,7 +1068,7 @@ else if (acct.isFinalAccount()) { balance[0] = chkp.getBalance(); txnCrit.add (Restrictions.gt ("postDate", chkp.getDate())); } - } else { + } else if (!ignoreBalanceCache) { BalanceCache bcache = getBalanceCache (journal, acct, layersCopy); if (bcache != null && bcache.getRef() <= maxId) { balance[0] = bcache.getBalance(); @@ -1458,6 +1459,14 @@ else if (entry.isDecrease()) { return balance; } + public boolean isIgnoreBalanceCache() { + return ignoreBalanceCache; + } + + public void setIgnoreBalanceCache(boolean ignoreBalanceCache) { + this.ignoreBalanceCache = ignoreBalanceCache; + } + // ----------------------------------------------------------------------- // PUBLIC HELPERS // -----------------------------------------------------------------------