Hi,
I've developped two applications
--- Step 1 ---
I start both applications
Application #1 is using JNDI connection under tomcat
Second one using standart JDBC connection
The two application are not located on the same computer
Database is MySQL with InnoDB table type
Object is linked "one to many" to another table
--- Step 2 ---
Application #1
Session session = HibernateUtil.currentSession();
Transaction tx = beginTransaction();
Object obj = new Obj();
session.save(obj);
tx.commit();
HibernateUtil.close();
Application #2
Session session = HibernateUtil.currentSession();
List objectList = session.find( "from Object as object WHERE object.code=(?)", code, Hibernate.STRING);
tx.commit();
HibernateUtil.close();
First querying OK, the new object is well selected
Application #1
Session session = HibernateUtil.currentSession();
Transaction tx = beginTransaction();
Object obj = new Obj();
session.save(obj);
tx.commit();
HibernateUtil.close();
Application #2
Session session = HibernateUtil.currentSession();
List objectList = session.find( "from Object as object WHERE object.code=(?)", code, Hibernate.STRING);
tx.commit();
HibernateUtil.close();
Second querying failed, the new Object is not found
I suppose it is a concurrency error because of when I did the same sequence into a single application it works
What can i do to resolve this error ?
I appreciate hibernate framework, thanks a lot for your job ;-)
|