I want to access cache before batch commit in Hibernate. I count users to BATCH_SIZE, then
if (countUsers == BATCH_SIZE) { countUsers = 0; session.flush(); session.clear(); transaction.commit(); session = HibernateUtil.getSessionFactory() .getCurrentSession(); transaction = session.beginTransaction(); }
What I do, I store 30 lines in cahce and then save them in the database. but I also want to get information about these cached lines before storing them in the database.
How to do it?
source share