-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate fails to read the data occasionally
PostPosted: Wed Feb 28, 2007 4:44 pm 
Newbie

Joined: Wed Feb 28, 2007 4:37 pm
Posts: 1
I am using Hibernate 3.1 on MySQL community server edition 5.0.18.
I am trying to load an entity from DB using the primary key. My code is fairly simple.

Session session = null;
Transaction tx = null;

try {
session = HibernateUtil.currentSession();
tx = session.beginTransaction();

abcDAO dao = abcDAO.getInstance();
Abc obj = dao.get(primaryKey, session);

} catch (Exception ex) {
return false;
} finally {
if (session != null) {
session.close();
}
}

The key I am trying to load is present in DB and I can connect to MySQL and confirm its presence. However, when reading using Hibernate, it does not load any data. Hibernate returns with no result.

Have any body seen this kind of behavior?

Any help is greatly appreciated.

Regards,
KG




Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject: How r u creating the primary key
PostPosted: Thu Mar 01, 2007 3:18 am 
Newbie

Joined: Mon Feb 19, 2007 12:54 am
Posts: 16
Location: banglore, india
Cau post me the code of creation of primary , mapping file.

_________________
Banglore Developer


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

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.