| Author |
Do Not Rollback Transaction for all roll refers another
|
hunabku santos
Greenhorn
Joined: Feb 06, 2013
Posts: 1
|
|
Hi
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)
customer Table:
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?
Tks []'s
|
 |
Kathleen Angeles
Ranch Hand
Joined: Aug 06, 2012
Posts: 115
|
|
Show us how these data are put into the db, and your transaction delimiters.
|
 |
Mark Spritzler
ranger
Sheriff
Joined: Feb 05, 2001
Posts: 17243
|
posted

0
|
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.
Mark
|
Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
|
 |
 |
|
|
subject: Do Not Rollback Transaction for all roll refers another
|
|
|