File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Do Not Rollback Transaction for all roll refers another
Joined: Feb 06, 2013
Feb 06, 2013 14:36:58
I trying including a family of people, one by one... and the son records referencing the children their parents.
I have one @Transactional(propagation= Propagation.REQUIRED, rollbackFor = Throwable.class)
ID_CUSTOMER | NAME_CUSTOMER | ID_FATHER_CUSTOMER
1 | BOB | (null)
2 | BOB SON | 1
3 | SANDY SON | 1
In this case, let's imagine that 'SANDY SON' has inconsistent data and the application will get throws an exception.
I am not able to perform the rollback of the entire family (BOB and BOB SON) .... They're already commited in the database. Why ?
I can not configure Spring do not commit in this situation described above?
How I can get rollback?
Joined: Aug 06, 2012
Feb 07, 2013 08:41:30
Show us how these data are put into the db, and your transaction delimiters.
Joined: Feb 05, 2001
Feb 08, 2013 14:11:11
Also, why did you put
rollbackFor = Throwable.class
No need for that unless you want to really want to restrict what Exceptions causes a rollback and what doesn't. Which is a very rare case.
Perfect World Programming, LLC
Two Laptop Bag
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Do Not Rollback Transaction for all roll refers another
Tip to switch job from US to India
Bit Shift Operator Signed Left Shift
Can someone explain the error @ Line-03
Rollback in JMS
JBoss Virtual Host
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015