Answer the question
In order to leave comments, you need to log in
Why doesn't Hibernate pick up new records in the database?
There is a database manager application with a web face and an application that pulls records from this database. As ORM I use Hibernate. The bottom line: if you put the n-th number of records in the database and then run the application, it will pull them out and process them. But if during the execution of the application (it is spinning in an eternal loop) an entry is added to the database, then Hibernate categorically refuses to pull it out and returns empty collections. Than it can be caused?
Answer the question
In order to leave comments, you need to log in
I suspect it's a caching issue. To flush cache use Session.clear()
From the instructions :
There are a lot of cleaning options, as seen in documentation .
Check how your transactions are completed after adding records, you may have forgotten to commit. Try to add a record and check its availability using the database itself (SQL query), and not in your application.
Plus, check the data reading logic, work under the debugger (or add messages to the log) and make sure that the application calls the read method periodically, and not just at startup.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question