-->
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: not loading all objects from storage
PostPosted: Fri Jul 29, 2005 1:40 pm 
Newbie

Joined: Tue Jul 12, 2005 7:01 am
Posts: 3
I have created an application, which stores some objects in a db.
After that i had to make a change, altered a table -> object too.

When i redeploy my app (the deploy dir is completly deleted) and i try to find old data in the db, it won't show up, if i go and modify something in the db then is showed up.

Can somebody give me a clue why ? and how to solve this ?!

_________________
Regards,
Paul


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 1:45 pm 
Regular
Regular

Joined: Thu May 26, 2005 2:08 pm
Posts: 99
Quote:
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:


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 2:36 pm 
Newbie

Joined: Tue Jul 12, 2005 7:01 am
Posts: 3
Okay my bad, let me refraze that.

Hibernate Version: 2.1.7c
Mapping documents:

User.hbm.xml

Code:
    <id
        name="id"
        type="java.lang.String"
        column="id"
    >
        <generator class="assigned" />
    </id>
   
    <version name="version"
       unsaved-value="negative"
       column="version"
       type="integer"
    />

    <property
        name="createdAt"
        type="java.util.Date"
        column="created_at"
        length="14"
    />
    <property
        name="lastUpdated"
        type="java.util.Date"
        column="last_updated"
        length="14"
    />

    ........... (other object data members)


my hibernate.cfg.xml
Code:
<hibernate-configuration>
   <session-factory>
      <property name="show_sql">false</property>
      <property name="hibernate.dialect">net.sf.hibernate.dialect.PostgreSQLDialect</property>
      <property name="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</property>
      <property name="hibernate.cache.use_query_cache">true</property>
      <property name="hibernate.use_outer_join">true</property>
      <property name="hibernate.query.substitutions">true=1 false=0</property>


and ehcache.xml
Code:
<ehcache>
    <diskStore path="java.io.tmpdir"/>

    <defaultCache
        maxElementsInMemory="10000"
        eternal="false"
        timeToIdleSeconds="120"
        timeToLiveSeconds="120"
        overflowToDisk="true"
        />

    <cache name="Group"
       maxElementsInMemory="1000"
        eternal="false"
        timeToIdleSeconds="60"
        timeToLiveSeconds="120"
        overflowToDisk="false"
        />
</ehcache>


i'm using spring HibernateDAOSupport

and in my DAO implementation i have

Code:
   public java.util.List getAllUsers() {
      return getHibernateTemplate().find("FROM User user");
   }


Database: postgresql 8.0.1
SQL: sorry but i don't have it right now

I altered the user class, added a new data member => User.hbm.xml too

The application runs in tomcat+liferay 3.2.0...

The upgrade of the program version is made by deleting the previous deploy dir, i though it was some cache problem so i deleted the cache files, the work directory from tomcat, redeployed

So the objects saved with the first version of the program (that one was using another hibernate version can't rember what version but it was a newer one) aren't "visible" on a query from the second version of the program, if i modify in the db then they show up...

some hints please...

_________________
Regards,
Paul


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 2:45 pm 
Newbie

Joined: Tue Jul 12, 2005 7:01 am
Posts: 3
i forgot my applicationContext.xml

Code:
   <bean id="DS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName">
         <value>${database.driver}</value>
      </property>
      <property name="url">
         <value>${database.url}</value>
      </property>
      <property name="username">
         <value>${database.userid}</value>
      </property>
      <property name="password">
         <value>${database.password}</value>
      </property>
      <property name="maxActive">
         <value>${database.maxActive}</value>
      </property>
      <property name="minIdle">
         <value>${database.minIdle}</value>
      </property>
   </bean>

   <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
      <property name="dataSource">
         <ref local="DS" />
      </property>
      <property name="configLocation">
         <value>classpath:hibernate.cfg.xml</value>
      </property>
   </bean>

   <bean id="hibernateTransactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager">
      <property name="sessionFactory">
         <ref local="sessionFactory" />
      </property>
   </bean>

   <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
        abstract="true">
      <property name="transactionManager">
         <ref bean="hibernateTransactionManager"/>
      </property>
      <property name="transactionAttributes">
         <props>
            <prop key="new*">PROPAGATION_REQUIRED</prop>
            <prop key="update*">PROPAGATION_REQUIRED</prop>
            <prop key="remove*">PROPAGATION_REQUIRED</prop>
            <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
         </props>
      </property>
   </bean>

_________________
Regards,
Paul


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.