Comments (2)
It's actually intended behavior. The BalanceCache doesn't intend to be synchronized with the very latest transaction for a given account at a given journal for a given set of layers. It's totally OK for miniGL to read a bunch of transaction entries (in the hundreds) to get the actual balance of a given account. That's very fast and performed by a database native query (on supported database).
The basic idea behind the BalanceCache is to prevent having to start for the very beginning of transentries and having to scan in some situations thousands of records.
We've choose the safe window value of 1000 because on heavy loaded systems, that's usually just a few seconds/minutes away from the latest transaction, and prevents some race conditions for in-flight transactions.
It was a mistake (my fault) to expose the balance caches as a public method of GLSession. It's actually a miniGL internal thing. Today we use the BalanceCache, tomorrow we could use something else, what we want is to provide fast balances. Something similar happens with CheckPoints. I hope to correct that design fault in future versions (and actually have some ideas in mind that I'm experimenting in PoC).
from jpos-ee.
Thanks for the great explanation. It all makes sense now.
from jpos-ee.
Related Issues (20)
- db.close should be in a finally block
- Create version of GLTransaction.createReverse(...) that preserve tags for created reversal entries
- Heartbeat holds onto the db session for a lot longer than required.
- Catch and log exception when DB session factory creation fails due to an uncaught mapping exception HOT 2
- Incapable of initializing JVM because of ExplicitGCInvokesConcurrentAndUnloadsClasses HOT 3
- Database dependent issue in getBalances (run tests on postgres) HOT 3
- Postgresql tests for minigl? HOT 1
- Elasticsearch module - is not working async HOT 1
- Jpos hangs on response 204
- Status hbm references non existent status column from SysLog HOT 4
- Unable to create slave databases in windows environment HOT 4
- Change visibility of ChannelMonitor's cfg and servicename to protected HOT 2
- Change DTD used from the SourceForge one to the hibernate one HOT 4
- Use try with resource to close Socket in Ping.java
- Use try with resource to close FileReader in DB.java
- Make the Debug participant extend the doPrepare(...) method to get profile dump the debug participant's timing info HOT 4
- QRest - handle headers greater than 8192 bytes (default)
- Consider upgrading Jetty to 10.x or 11.x
- A lot of check methods are not going through the entire list of params for validation HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpos-ee.