-->
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: changes are not being reflected,only after restarting server
PostPosted: Tue Oct 19, 2010 10:20 am 
Newbie

Joined: Mon Oct 11, 2010 7:44 am
Posts: 4
Hi,

I am using hibernate and spring mvc, when i insert a record in DB, and try to access that that right after that, then i don't get the result.
e.g.
if insert a record for newly reg. user and login in him right after registering it then result set is empty.
I am using hibernate templates.


my [app].servlet.xml

Code:
          <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost/dbb" />
        <property name="username" value="r123" />
        <property name="password" value="1234" />
      </bean>
      <bean id="hbSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="mappingResources">
          <list>
            <value>UserAttributes.hbm.xml</value>
            <value>BlessUser.hbm.xml</value>
            <value>SnsType.hbm.xml</value>
            <value>SnsUser.hbm.xml</value>
            <value>SnsAuthenticator.hbm.xml</value>
          </list>
        </property>
        <property name="hibernateProperties">
          <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop>
            <prop key="hibernate.transaction.flush_before_completion">false</prop>
            <prop key="hibernate.transaction.auto_close_session">false</prop>
            <prop key="hibernate.show_sql">true</prop>
          </props>
        </property>
        <property name="dataSource">
          <ref bean="dataSource" />
        </property>
      </bean>


DAO method

Code:
   public void saveOrUpdate(E transientObject) {
      getHibernateTemplate().saveOrUpdate(transientObject);
   }


HBM

Code:
<hibernate-mapping>

  <class name="com.utilami.model.BlessUser" table="bless_user">

    <id name="Id" type="java.lang.Integer" column="bless_uid">
      <generator class="native" />
    </id>

    <property column="name" length="255" name="Name" not-null="false" type="java.lang.String" />

    <property column="email" length="255" name="Email" not-null="false" type="java.lang.String" />

    <property column="user_name" length="255" name="UserName" not-null="false"  type="java.lang.String" />

    <property column="password" length="255" name="Password" not-null="false" type="java.lang.String" />

    <set name="snsUser" lazy="false" cascade="all" table="sns_User">
      <key column="bless_uid" />
      <one-to-many class="com.utilami.model.SnsUser" />
    </set>
  </class>
</hibernate-mapping>


what could be the problem and what i am missing...
thx. plzzzzzzzzz


Top
 Profile  
 
 Post subject: Re: changes are not being reflected,only after restarting server
PostPosted: Wed Oct 20, 2010 4:19 am 
Newbie

Joined: Mon Oct 11, 2010 7:44 am
Posts: 4
any 1???


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.