Hi,
I have 2 applications that use the same database, one is the application for the Administrator, where all the configuration is done.
The second application is where the users take examens that the Administrator assigned. The 2 application are in separated wars.
The problem is that if the Administrator in his application assign a Exam to a user, the change in the second application for normal user is not registered. After every commit I flush the session in the Administrator application.
The way I create and handle the session in both application is in the following way.
Code:
public class HibernateUtil {
private static SessionFactory sessionFactory;
static {
try {
sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory();
} catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
public static Session getSession() throws HibernateException {
return sessionFactory.openSession();
}
}
Thanks in advanced