Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Default value for @TransactionAttribute.(What's Default value for @TransactionAttribute.)
Default value for @TransactionAttribute. [message #1517776] Fri, 19 December 2014 18:54 Go to next message
Faraz Ali is currently offline Faraz AliFriend
Messages: 1
Registered: December 2014
Junior Member
Hi,

I am new to EclipseLink.
What's default value for @TransactionAttribute?

If we mark class with TransactionManagementType CONTAINER, should we need to mark every method with annotation @javax.ejb.TransactionAttribute to support transaction?
Is there anyway to set default value for @javax.ejb.TransactionAttribute?
I don't want to put this annotation on every function in class.

Any help would be much appreciated.
Re: Default value for @TransactionAttribute. [message #1522436 is a reply to message #1517776] Mon, 22 December 2014 10:04 Go to previous message
Petros Splinakis is currently offline Petros SplinakisFriend
Messages: 12
Registered: September 2014
Junior Member
Default value for TransactionAttribute is REQUIRED. REQUIRED is also the default if no TransactionAttribute annotation is used and the EJB in question uses container managed transactions.
Marking the EJB with CONTAINER TransactionManagementType means that every method is transactional and by default using REQUIRED TransactionAttributeType. You may even skip the TransactionManagement annotation, since CONTAINER TransactionManagementType is enabled by default for EJBs. You may use the TransactionAttribute annotation to override the default.
You may use the TransactionAttribute annotation either on class or method level or both, in which case method annotation will override class annotation for the specific method.
Previous Topic:NamedPLSQLStoredProcedureQuery with multiple out parameters
Next Topic:Insert statements generated with the same attribute repeated multiple times
Goto Forum:
  


Current Time: Mon Feb 26 09:04:26 GMT 2024

Powered by FUDForum. Page generated in 0.01777 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top