-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem when gathering data from a database
PostPosted: Fri Feb 13, 2004 12:15 pm 
Newbie

Joined: Fri Feb 13, 2004 9:53 am
Posts: 4
Hi!

I'm having some trouble with hibernate. Take a look:

Code:
Collection ocorrencias = session.list("from OcorrenciaVO as o where o.statusControle="+ codStatus + " order by o.id");

Iterator i = ocorrencias.iterator();
while(i.hasNext())
{
    Ocorrencia o = (Ocorrencia)i.next();
    String fileName = o.getImagePath();

    if(fileName == null)
    {
        //at this point, I get the imagePath property using JDBC and, for my
        //surprise, the field has a value (it is not null).
        //Like this:
        //stmt.executeQuery("select * from ocorrencia where id=" + o.getId()");
    }

}


If the field has a value in the database, why hibernate is assuming null in imagePath property?

The database is huge! And this situation happens only a few times.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 13, 2004 1:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
What is the mapping for the property?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 8:00 am 
Newbie

Joined: Fri Feb 13, 2004 9:53 am
Posts: 4
This is the mapping:

Code:
<property name="imagePath" type="string" update="true" insert="true" column="image_path" length="50" />


That situation occurs only a few times. Let's say that it occurs 1 time in 10. So, i believe that maybe the mapping is not the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 17, 2004 8:22 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Hm, propably something with your transaction isolation is wrong, and another request is changing the record in the background? Could that be possible?


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