-->
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.  [ 3 posts ] 
Author Message
 Post subject: Why this happen?Need help!
PostPosted: Tue Aug 08, 2006 5:21 am 
Newbie

Joined: Tue Aug 08, 2006 4:19 am
Posts: 2
Location: singapore
My project uses SPRING+HIBERNATE+STRUTS.
Now when I use hibernate query, a strange exception occurs!

rs = (ArrayList)session.createQuery("from xxx where Code = ?").setString(0,code).list();

[color=red]If there is data in database, rs return [null].[/color]
if there is no data in database, rs return null.
How come?

Spring manages hibernate sessions.
I am not sure whether it is caused by spring settings or not?
How can I do to resolve the problem?

Thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 6:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
that method can never return null....

is that session or query somehow proxied by spring or something ?

If yes, I would look there for some unhandled error.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 09, 2006 9:26 pm 
Newbie

Joined: Tue Aug 08, 2006 4:19 am
Posts: 2
Location: singapore
ya.
the hibernate session is managed by spring.
How come the query return [null]?
So strange.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.