-->
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: Declarative Transactional Management Issue
PostPosted: Tue Apr 29, 2008 10:46 am 
Newbie

Joined: Tue Apr 29, 2008 10:30 am
Posts: 1
Hi all,

I'm doing a project using Hibernate3.0. I have studied some tutorials on transactional management. However, when I implement it on my project, it's not work. The configuration is shown below:

[code]
<bean class="org.springframework.jdbc.datasource.DriverManagerDataSource" id="dataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/test</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>123123</value>
</property>
</bean>

<bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" id="sessionFactory">
<property name="dataSource">
<ref local="dataSource"/>
</property>
<property name="lobHandler">
<ref local ="lobHandler"/>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
</props>
</property>
</bean>

<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean class="com.aat.dao.HibernateDAOImpl" id="HibernateDAO">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
</bean>

<bean id="tranFormTarget" class="com.aat.services.AssetTransferManagerImpl">
<property name="hibernateDAO" ref="HibernateDAO"/>
</bean>

<bean id="tranFormBean" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager" ref="transactionManager"/>
<property name="target">
<ref local="tranFormTarget"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="save">PROPAGATION_REQUIRED</prop>
<prop key="update">PROPAGATION_REQUIRED</prop>
<prop key="approve">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>


public interface AssetTransferManager {
public void save(AssetTransferForm objForm) throws DataAccessException, SQLException, ParseException;
public void updateTranForm(TranForm obj);
public void approve(ActionForm form, HttpServletRequest request);
}

[/code]

When it runs with exception, the records cannot be rollback. What's wrong with it?

Thanks!!

Best regards,
Terry


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 8:34 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
This is the Hibernate forum and you're asking a Spring question. Try the Spring forum.

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.