So I need to set the timeout parameter for @Transactional annotation. This property will come from a property file which I'm not able to do since I'm encountering "The value for annotation attribute Transactional.timeout must be a constant expression". Something like this
@Value("${mytimeout}")
private int myTimeout;
@Transactional(timeout=myTimeout)
public void myMethod(){
}
The only time the timeout attribute can be set by a variable is when a variable is final.
So, I was thinking if it is possible to set the timeout property programmatically while using the @Transaction annotation. Or any other way I can set this attribute Thanks!