-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Concurrency, second call to find() function failed
PostPosted: Mon Jun 07, 2004 4:50 pm 
Beginner
Beginner

Joined: Mon Jun 07, 2004 4:31 pm
Posts: 45
Location: France
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 ;-)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.