We have an application that uses a class that has static methods. This class contains methods that do "database work". There are many methods in the class but, for this issue, there are two that I am concerned about - one that reads records in a DB2 table (using sql) that are "ready to process" and one that updates records that have been processed as "processed". Also this application is single threaded.
The application calls the method to pull all records that are "ready to process" and once they are processed, the records are updated as processed. Periodically (not very often), we will read records to process, process them, mark the records as processed and then soon after (20 seconds maybe) those records will be pulled again in the "ready to process" query. Even though we know the records have already be updated as "processed". It's almost as if the queries are looking at old data and not seeing the records are already marked as processed.
I'm wondering if the fact that the methods are static could cause this type of behavior. Maybe things remain in memory so that we're looking at "old data" when calling the "ready to process" method?
I'm not sure if it's a db2 issue (auto-commit has some delay, etc), but I wanted to rule out what types of things using static methods could contribute to this issue.
Thanks for any advice.