[ 
https://issues.apache.org/jira/browse/ARIA-117?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15906536#comment-15906536
 ] 

ASF GitHub Bot commented on ARIA-117:
-------------------------------------

Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/75#discussion_r105559391
  
    --- Diff: aria/orchestrator/context/operation.py ---
    @@ -64,11 +67,19 @@ def task(self):
             The task in the model storage
             :return: Task model
             """
    -        if not self._task:
    +        # SQLAlchemy prevents from accessing an object which was created 
on a different thread.
    +        # So we retrieve the object from the storage if the current thread 
isn't the same as the
    +        # original thread.
    +        if not self._task or self._current_thread_id != 
self._current_thread:
                 self._task = self.model.task.get(self._task_id)
    +            self._current_thread = self._current_thread_id
             return self._task
     
         @property
    +    def _current_thread_id(self):
    --- End diff --
    
    be a man. save it in a thread local.


> Log model should have an Task field
> -----------------------------------
>
>                 Key: ARIA-117
>                 URL: https://issues.apache.org/jira/browse/ARIA-117
>             Project: AriaTosca
>          Issue Type: Task
>            Reporter: Maxim Orlov
>            Assignee: Maxim Orlov
>
> The Log model currently doesn't relate to a specific task.
> The field should be added to the model.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to