-
Jan 7th, 2013, 11:53 PM
#1
Transaction can not rollback, help me.
Hello,everyone:
Today I meet a problem that transaction can not rollback. Spring version 2.5.6SEC02
In my code, transaction config is:
[ code]
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" />
<tx:method name="create*" propagation="REQUIRED" />
<tx:method name="modify*" propagation="REQUIRED" />
<tx:method name="remove*" propagation="REQUIRED" />
<tx:method name="manager*" propagation="REQUIRED" />
<tx:method name="sync*" propagation="NOT_SUPPORTED"/>
<tx:method name="*" read-only="true" propagation="SUPPORTS" />
</tx:attributes>
</tx:advice>
[/code ]
When I invoke a method named modify***, and in this method a RuntimeException is thrown. But the transaction does not rollback, and there are some dirty data in DB.
I debug, and find getTransactionManager().rollback(txInfo.getTransac tionStatus()) does invoke. But dirty data in DB does not rollback......Then I view the result of getTransactionManager() ,and find the datasource is correct. Then I continue view txInfo.getTransactionStatus(), I find transaction.jpg
the rollbackOnly=false, Is it the reason?
Last edited by zwzm85; Jan 8th, 2013 at 01:33 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules