Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
0.4
-
None
Description
@Transactional currently open a transaction when method is invoked.
if a sub method is invoked also annoted @Transactional the second method uses the first method transaction and not a new one.
ex:
@Transactional
void createEntity(){
...
audit()
throw Exception("a problem occurs here")
}
@transactional
void audit(){
//persist some audit stuff
...
}
Actually everything is rolled back because of the exception in the top method (createEntity)
@transactional should have a parameter like (REQUIRE_NEW, NEVER...) to handle with details transaction's lifecycle