[
https://jira.jboss.org/jira/browse/EJBTHREE-1844?page=com.atlassian.jira....
]
Matthias Lanz commented on EJBTHREE-1844:
-----------------------------------------
Hi Carlo,
sounds very good, exactly what I were looking for :-)
I think this new annotation can be applied as default for all SLSB in
ejb3-interceptors-aop.xml, that would be very useful.
If it can be applied to all session beans by default it would be neccessary that
"numRetries=0" is a valid value, to disable retry for specific beans.
I wonder how nested session bean calls are handled. I assume this annotation can only have
any effect on session bean methods that are starting a new transaction, not using one
previously started from the caller?
As a extension in the future it would be nice if one could define any kind of
retry-handler; an interface which can be implemented to decide on which exceptions a retry
should occur.
Example:
@TransactionRetry(numRetries=4, waitTime=1, waitTimeUnit=TimeUnit.SECONDS,
retryHandler=MyPersonalOnlyDeadlockRetryHandler.class)
and then:
public class MyPersonalOnlyDeadlockRetryHandler implements com.jboss.ejb3.RetryHandler {
public boolean isRetryable(Exception e) {
return (e instanceof EJBRolledbackException && e.getCause() instanceof
MySqlDeadLockDetectedException);
}
But that is really a nice-to-have, retries on every error should do no harm.
Retry operations after an EJBTransactionRolledbackException
-----------------------------------------------------------
Key: EJBTHREE-1844
URL:
https://jira.jboss.org/jira/browse/EJBTHREE-1844
Project: EJB 3.0
Issue Type: Feature Request
Components: transactions
Reporter: Carlo de Wolf
Assignee: Carlo de Wolf
By either annotating a bean or its methods, the applicable methods will retry the
operation if an EJBTransactionRolledbackException occurs.
@TransactionRetry(numRetries=4, waitTime=1, waitTimeUnit=TimeUnit.SECONDS)
numRetries specifies how many times an operation will be tried.
waitTime specified the amount of time to wait before retrying with the unit of time
specified in waitTimeUnit.
Default is 3 retries and 1000 milliseconds wait time after an
EJBTransactionRolledbackException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira