Hi,
I am facing some interesting problem with hibernate in my application.
i have two applications in my project; 1. java application 2. web-application(struts) and i have used hibernate in both of them to communicate to the database and both has individual hibernate session factories.
I insert the records into the database using my web-application and i read and display the records from db using my java application and here, my java application is a Timer task one, scheduled to run every 10 seconds.
when i start my java application for the first time, it works fine. it reads the records and display well. but if i insert some more records thru my web-application then my java app is not able to read them. it is returning zero result set. but, when i stop and run my java app then it is able to pick the latest records from db.
In brief, my java application is not seeing the refreshed result set after very addition the web application makes.
i disabled the hibernate's second-level cache also.
i would be thankful if someone can help me out in resolving this issue.
and pls let me know, if i have missed any setting with my hibernate usage.
TIA
-Shariff.
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.x
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Query query = session.createQuery("select pubQ from PmPublisherQueue as pubQ where pubQ.PmStatusMaster.StatusCode='"+DownloadConstants.NEW_ENTRY+"'");
List url_List = query.list();
if (url_List != null && url_List.size() >0) {
pubQ = (PmPublisherQueue)url_List.get(0);
}
// after session.close();
return pubQ;
Full stack trace of any exception that occurs:
Name and version of the database you are using:
MySQL 5.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html