[
https://issues.apache.org/jira/browse/AMBARI-4357?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
John Speidel updated AMBARI-4357:
---------------------------------
Description:
I am looking at the ServiceResourceProvider class which is responsible for
setting/getting information related to the service resource from the Ambari DB
and see that JPA is being used.
Looking at how transactions are demarcated in this class, I have serious
concerns.
- The getter method 'getResources' has a '@Transactional' annotation even
though it doesn't perform any database writes.
- The create and update methods 'createResources' and 'updateResources', which
do update the database, have no transactional annotations.
I can think of no explanation where this transactional behavior would be
correct. This behavior needs to be understood, reviewed and corrected. If
this is the desired behavior, it needs to be clarified.
The required concurrency guarantees for the writes and reads need to be
explained. For example, what read consistency is required.
was:
I am looking at the ServiceResourceProvider class which is responsible for
setting/getting information related to the service resource from the Ambari DB
and see that JPA is being used.
Looking at how transactions are demarcated in this class, I have serious
concerns.
- The getter method 'getResources' has a '@Transactional' annotation even
though it doesn't perform any database writes.
- The create and update methods 'createResources' and 'updateResources', which
do update the database, have no transactional annotations.
I can think of no explanation where this transactional behavior would be
correct. This behavior needs to be understood, reviewed and corrected. If
this is the desired behavior, it needs to be clarified.
> ServiceResourceProvider appears to use transactions incorrectly
> ---------------------------------------------------------------
>
> Key: AMBARI-4357
> URL: https://issues.apache.org/jira/browse/AMBARI-4357
> Project: Ambari
> Issue Type: Bug
> Components: controller
> Reporter: John Speidel
>
> I am looking at the ServiceResourceProvider class which is responsible for
> setting/getting information related to the service resource from the Ambari
> DB and see that JPA is being used.
> Looking at how transactions are demarcated in this class, I have serious
> concerns.
> - The getter method 'getResources' has a '@Transactional' annotation even
> though it doesn't perform any database writes.
> - The create and update methods 'createResources' and 'updateResources',
> which do update the database, have no transactional annotations.
> I can think of no explanation where this transactional behavior would be
> correct. This behavior needs to be understood, reviewed and corrected. If
> this is the desired behavior, it needs to be clarified.
> The required concurrency guarantees for the writes and reads need to be
> explained. For example, what read consistency is required.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)