-->
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: Can not return the list page
PostPosted: Mon Jun 16, 2008 2:49 am 
Newbie

Joined: Fri Jun 13, 2008 11:27 am
Posts: 6
the saveCustomer in Dao impl is:

public boolean saveCustomer(TblCustomerInfo customerInfo) {

getHibernateTemplate().save(customerInfo);
return true;
}

and the applicationContext.xml related the transaction setting is:

<!-- Transaction setting -->
<bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>

<bean id="transactionProxy" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="txManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="get*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>


But when i called the save method,the data only save the database for a moment,then it will lost from the database.Or sometime it will block the database.I integrate the hibernate with the spring and let spring to manage the transaction.What 's wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 16, 2008 8:25 am 
Expert
Expert

Joined: Fri Jul 13, 2007 8:18 am
Posts: 370
Location: london
All you've done is define an abstract transaction factory parent bean, not created any transactional services.

You need this part too:
Code:
<bean id="customerDao" parent="transactionProxy">
  <property name="target">
    <bean class="com.txhdeve.dao.CustomerDaoImpl">
    </bean>
  </property>
</bean>


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.