Closed amoeba closed 4 years ago
I confirmed Michael's report, and could reproduce the bug on both vegbank.org and vegbankdev. I tested locally and could not reproduce it which I find really odd since my Java and PostgreSQL versions are the same as on our VMs.
I found what looks like the culprit in vegbank.log
:
org.postgresql.util.PSQLException: Operation requires a scrollable
ResultSet, but this ResultSet is FORWARD_ONLY
The offending line of code is:
which appears to require a scrollable result set.
Vegbank performs all of its database operations with a lightweight helper on top of various java.sql
classes and issuing a select looks like:
So I refactored issueSelect(String)
to be polymorphic by adding a issueSelect(String, int, int)
form which allows flags to be passed like:
da.issueSelect(DatabaseUtility.removeSemicolons(query.toString()),
ResultSet.CONCUR_READ_ONLY,
ResultSet.TYPE_SCROLL_INSENSITIVE);
issueSelect(String)
simply calls issueSelect(String, int, int)
with the default flags (read only, non-scrollable) and is used in 51 places in the codebase. issueSelect(String, int, int)
is only directly needed for this single usage in the dataset/cart feature.
I deployed updated code to vegbankdev
and will coordinate with Michael Lee to help me verify the fix.
Things left to do:
Michael Lee reported this one:
Steps to reproduce:
Expected: Only one is removed.