Commit e885bfb8f9673f184fa8b4dc7ae410b0be5ff409
Exists in
master
Merge branch '2.3' of git@github.com:demoiselle/framework.git into 2.3
Showing
2 changed files
with
15 additions
and
1 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/implementation/TransactionInfo.java
| @@ -47,7 +47,16 @@ public class TransactionInfo implements Serializable { | @@ -47,7 +47,16 @@ public class TransactionInfo implements Serializable { | ||
| 47 | 47 | ||
| 48 | private int counter = 0; | 48 | private int counter = 0; |
| 49 | 49 | ||
| 50 | - private boolean owner = false; | 50 | + private boolean owner; |
| 51 | + | ||
| 52 | + public TransactionInfo() { | ||
| 53 | + clear(); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + public void clear() { | ||
| 57 | + this.owner = false; | ||
| 58 | + this.counter = 0; | ||
| 59 | + } | ||
| 51 | 60 | ||
| 52 | public int getCounter() { | 61 | public int getCounter() { |
| 53 | return counter; | 62 | return counter; |
impl/core/src/main/java/br/gov/frameworkdemoiselle/internal/interceptor/TransactionalInterceptor.java
| @@ -167,9 +167,14 @@ public class TransactionalInterceptor implements Serializable { | @@ -167,9 +167,14 @@ public class TransactionalInterceptor implements Serializable { | ||
| 167 | if (transactionInfo.isOwner()) { | 167 | if (transactionInfo.isOwner()) { |
| 168 | if (transaction.isMarkedRollback()) { | 168 | if (transaction.isMarkedRollback()) { |
| 169 | transaction.rollback(); | 169 | transaction.rollback(); |
| 170 | + transactionInfo.clear(); | ||
| 171 | + | ||
| 170 | getLogger().info(getBundle().getString("transaction-rolledback")); | 172 | getLogger().info(getBundle().getString("transaction-rolledback")); |
| 173 | + | ||
| 171 | } else { | 174 | } else { |
| 172 | transaction.commit(); | 175 | transaction.commit(); |
| 176 | + transactionInfo.clear(); | ||
| 177 | + | ||
| 173 | getLogger().info(getBundle().getString("transaction-commited")); | 178 | getLogger().info(getBundle().getString("transaction-commited")); |
| 174 | } | 179 | } |
| 175 | } | 180 | } |