[ 
https://issues.apache.org/jira/browse/ARIA-265?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ran Ziv updated ARIA-265:
-------------------------
    Description: 
When using multi-threaded plugins, sometimes a {{Database is locked}} error 
gets raised.

The reason for this is that each thread automatically receives a separate 
session from {{SQLAlchemy}} for communication with the database. This session 
must be closed properly before the thread terminates, or else other attempts of 
interacting with the database could hang (and lead to the error mentioned 
above).


One way to avoid this is for plugin authors to ensure they shut the session 
down properly for each thread the plugin creates.

Another possible solution would be to save all sessions created on the 
operation's {{ctx}} object, and clean them up automatically afterwards.


  was:
When using multi-threaded plugins, sometimes a {{Database is locked}} error 
gets raised.

The reason for this is that each thread automatically receives a separate 
session from SQLAlchemy for communication with the database. This session must 
be closed properly before the thread terminates, or else other attempts of 
interacting with the database could hang (and lead to the error mentioned 
above).


One way to avoid this is for plugin authors to ensure they shut the session 
down properly for each thread the plugin creates.

Another possible solution would be to save all sessions created on the 
operation's {{ctx}} object, and clean them up automatically afterwards.



> Database locked errors when using multi-threaded plugins 
> ---------------------------------------------------------
>
>                 Key: ARIA-265
>                 URL: https://issues.apache.org/jira/browse/ARIA-265
>             Project: AriaTosca
>          Issue Type: Bug
>            Reporter: Ran Ziv
>            Priority: Minor
>
> When using multi-threaded plugins, sometimes a {{Database is locked}} error 
> gets raised.
> The reason for this is that each thread automatically receives a separate 
> session from {{SQLAlchemy}} for communication with the database. This session 
> must be closed properly before the thread terminates, or else other attempts 
> of interacting with the database could hang (and lead to the error mentioned 
> above).
> One way to avoid this is for plugin authors to ensure they shut the session 
> down properly for each thread the plugin creates.
> Another possible solution would be to save all sessions created on the 
> operation's {{ctx}} object, and clean them up automatically afterwards.



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

Reply via email to