ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Speidel (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-4357) ServiceResourceProvider appears to use transactions incorrectly
Date Mon, 20 Jan 2014 19:51:22 GMT

     [ 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)

Mime
View raw message