-
-
You must be signed in to change notification settings -
Use @Transactional when handling JPA ticket/service ops #1825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is also relevant for #1772 |
@NotNull | ||
@Autowired | ||
@Qualifier("authenticationManager") | ||
@Resource(name="authenticationManager") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a note on the unrelated work I'm doing on another - I do the opposite i.e. replacing the use of @Resource
with @Autowired @Qualifier
combination to be consistent throughout our config infrastructure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that done just for consistency? One-liner @resource tags seems easier to read me, no? (I also do know @Autowired does not work with generic collections, though 4.3 will likely fix that)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency and also @Resource
did not work for me in some scenarios (don't remember which. Could be constructor injection, etc.). In general @Autowired
is more powerful and leverages the full power of Spring, etc. Let's pick an autowiring injection style and stick to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. I'll swich over.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, +1 on the change from me.
* moved onto transactional annotations with JPA ticket registry * moved onto transactional annotations with JPA svc registry * moved onto transactional annotations with JPA svc registry * moved onto transactional annotations with JPA svc registry * moved onto transactional annotations with JPA svc registry * moved onto transactional annotations with JPA svc registry * moved onto transactional annotations with JPA svc registry * fixed version number * moved onto transactional annotations with JPA svc registry * Fixed test cases; reverted to autowired * Fixed test cases; reverted to autowired
Closes #1817
Backported the service registry initialization feature from master as well. Tested with both Service and Ticket JPA registries and HSQLDB 2.3.4.