-
15. Re: Transaction is not active with @Create annotation
gjeudy Mar 28, 2008 7:51 PM (in response to gjeudy)Can somebody educate me with the Marked abort only behavior on a transaction ? Is this usually happening when a root exception further down the stack is the cause of a rollback ?
Due to a rather unusual requirement I cannot use REQUIRES NEW as a workaround because all db operations must occur using the same db connection/transaction. We achieve this with seam managed transactions combined with datasource/JCALoginModule CallerIdentity solution.
Is this a user error or a framework bug ? (Seam or JBoss tx management) ? Nothing from the stacktrace tells me that it is a user error.
Any help is appreciated,
Still haven't found a solution to prevent the exception from happening. -
16. Re: Transaction is not active with @Create annotation
pmuir Mar 29, 2008 7:29 PM (in response to gjeudy)
Guillaume Jeudy wrote on Mar 27, 2008 06:21 PM:
I have verified and my @Create and @Factory annotated methods are invoked during the render response phase so they should be working inside a transaction correct ?They are, inside an aborted transaction
If Seam starts the transaction then it is no longer container managed ?No, Seam asks the container to begin and end a transaction - still container managed. This is no different to you starting/ending a CMT.
Would it be why the default TransactionalAttribute.REQUIRED does not kick in and create a transaction for me ?REQUIRED doesn't create a transaction if one is already in progress which can be joined (whatever its state).
Then how to explain that TransactionalAttribute.REQUIRES NEW fixes the problem ?Because it forces the container to start a new transaction (which isn't aborted).
I don't want to disable seam transaction management because as you know, developing using the seam programming model requires many calls to SFSBs from the view layer and I don't want a new transaction created for every call.You shouldn't ;-)
Can somebody educate me with the Marked abort only behavior on a transaction ? Is this usually happening when a root exception further down the stack is the cause of a rollback ?The cause won't be in that stack trace, but rather another problem earlier in the JSF lifecycle which caused the abort.
Is this a user error or a framework bug ? (Seam or JBoss tx management) ? Nothing from the stacktrace tells me that it is a user error.User error, identify and remove the earlier problem and it will all start working.
-
17. Re: Transaction is not active with @Create annotation
gjeudy Apr 1, 2008 4:30 PM (in response to gjeudy)Sorry, I haven't read Pete's answer when I posted my previous post.
This is all very clear to me now. Unfortunately or fortunately the exception is no longer occurring so I cannot troubleshoot further. I recall having browsed the logs quite extensively and don't recall seeing any stacktraces or suspicious log messages before the
Transaction is not active
exception.I will post an update if I do find the answer to this mystery.
Thank you,
-Guillaume -
18. Re: Transaction is not active with @Create annotation
vladimir.kovalyuk Apr 1, 2008 5:56 PM (in response to gjeudy)I usually set breakpoint on RemoveInterceptor.removeIfNecessary(Method, Exception) and check exception when it occurs.
I'm not sure it helps in the situation like described. It depends on the source of exception. -
19. Re: Transaction is not active with @Create annotation
gjeudy Apr 2, 2008 3:19 PM (in response to gjeudy)I found the root cause which was an exception occurring during execution of the @Factory method, it took me a while but I managed to trap the root exception in debug mode in Ejb3TxPolicy.handleInCallerTx() method. For some reason, after this method wrapped the exception in a EJBTransactionRolledbackException and rethrown it, I no longer have access to the root cause in debug mode or in the server logs.
Confirmed this is a user error and not a framework or JBoss AS bug, though it would help if the full stack was printed out in the logs.