-->
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: Error refreshing list
PostPosted: Tue Feb 01, 2005 9:22 pm 
I am having trouble getting this code to refresh when called multiple times.

The first time the code is called data is correctly retrieved, however, any subsequent calls returns the same data.

The odd part about this is that every time the code is called an sql statement is generated.


Thanks in advance:
Mike Barnes

Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
2.1.7
Mapping documents:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="org.tiaa.cbi.model">

<class name="BuildItem" table="BuildHistory">
<id name="id">
<generator class="native"/>
</id>
<property name="timestamp" type="java.util.Date" />
<property name="loc" />
<property name="numUnitTests" />
<property name="numPackages" />
<property name="numClasses" />
<property name="scoreCard" />
<property name="buildLabel" length="15" />
<property name="duration" length="30" />
<many-to-one name="project" not-null="true"/>
</class>

</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping
package="org.tiaa.cbi.model">

<class name="Project" >
<id name="id">
<generator class="native"/>
</id>
<property name="projectName" length="50" not-null="true"/>
<property name="buildMachine" length="20" />
<property name="portNum" type="int" length="6" />
<property name="scoreCard"/>
<property name="loc"/>
<property name="numClasses"/>
<property name="numPackages"/>
<property name="numUnitTests"/>
<property name="buildLabel" length="15" />
<property name="buildStatus" length="20" />
<bag name="builds" lazy="true" inverse="true" cascade="all-delete-orphan">
<!-- bag name="builds" lazy="true" inverse="true" cascade="all-delete-orphan" -->
<key column="project"/>
<one-to-many class="BuildItem"/>
</bag>

</class>

</hibernate-mapping>


Code between sessionFactory.openSession() and session.close():
List list = null;
list = HibernateUtil.getSession()
.createCriteria(Project.class)
.addOrder(Order.asc("projectName"))
.list();
HibernateUtil.closeSession();

Full stack trace of any exception that occurs:

Name and version of the database you are using:
MySQL 4.1


Top
  
 
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.