transactions
transactions copied to clipboard
Add timeout attribute to the javax.transaction.Transactional annotation
Add additional method to the @Transactional annotation to set the TX timeout:
public @interface Transactional
{ (...) long timeout(); TimeUnit unit() default TimeUnit.MILLISECONDS; }
- Issue Imported From: https://github.com/javaee/jta-spec/issues/13
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by abien
@glassfishrobot Commented lprimak said: Timeout should have default value as not to break compatibility with current applications Also, the timeout specified above should be overridable by XML as it stands now
@glassfishrobot Commented abien said: The question is: should we prescribe a default TX timeout, or should it be "unspecified" => a proprietary application-server configuration
@glassfishrobot Commented lprimak said: I'd say unspecified to preserve more like how the configuration is done now
@glassfishrobot Commented paul_parkinson said: Yes, this conversation has been had before actually and the resolution (right or wrong) was to leave it unspecified.
Also, we've had the conversation over being able to specify transaction timeout in UserTransaction/TransactionManager.begin which would be the API equivalent to this annotation support. When discussing this, we also went down the path of being able to provide arbitrary values to begin, i.e. a begin(Map properties) API addition and so we should consider all of this when designing the annotation enhancement.
@glassfishrobot Commented Was assigned to paul_parkinson
@glassfishrobot Commented This issue was imported from java.net JIRA JTA_SPEC-13