Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible performance issue in minigl module getBalance() #76

Open
plarsson opened this issue May 25, 2018 · 8 comments
Open

Possible performance issue in minigl module getBalance() #76

plarsson opened this issue May 25, 2018 · 8 comments

Comments

@plarsson
Copy link

For example the balance cache is never used by FinalBalance min/max rules as it sends in a max id of 0
I think the balance cache should be allowed to use when maxId is sent in as 0?

See this line: https://github.com/jpos/jPOS-EE/blob/master/modules/minigl/src/main/java/org/jpos/gl/GLSession.java#L1072

@ar
Copy link
Member

ar commented May 25, 2018

If I understand correctly, you're reporting that we are not using a balance cache that we could have used, but balance is still accurate, right?

@plarsson
Copy link
Author

plarsson commented May 25, 2018

Yes thats correct. It's just a performance issue

@plarsson plarsson changed the title Possible bug in minigl module getBalance() Possible perfomance issue in minigl module getBalance() May 25, 2018
@ar
Copy link
Member

ar commented May 25, 2018

Perfect - will take a deep look and comment.

@plarsson plarsson changed the title Possible perfomance issue in minigl module getBalance() Possible performance issue in minigl module getBalance() May 25, 2018
@ar
Copy link
Member

ar commented May 26, 2018

FYI, I'm testing the following change, trying to verify side-effects.

                if (bcache != null && (maxId == 0 || bcache.getRef() <= maxId)) {
                    balance[0] = bcache.getBalance();
                    entryCrit.add (Restrictions.gt("id", bcache.getRef()));
                }

@ar ar closed this as completed in 97b652c May 26, 2018
@ar ar reopened this Jun 20, 2018
ar added a commit that referenced this issue Jun 20, 2018
@plarsson
Copy link
Author

Hi, did you find any issues with this fix?

@ar
Copy link
Member

ar commented Jun 28, 2018

Unfortunately we had a situation where balance_cache was not right. We are investigating if this was a DB procedure issue or something else. We are investigating. For the time being, I've temporarily reverted the change.

@cdanielpy
Copy link

@ar How did they proceed with this case? We occasionally used to encounter similar situations. In balance-cache, there was a record pointing to an unconfirmed transaction at the SQL level, and when calculating the balance afterwards, it returned an incorrect value.

@ar
Copy link
Member

ar commented Jan 22, 2024

@cdanielpy what you report might be related to an issue with your transaction isolation configuration at the JDBC level. Could that be the case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants