RE: Database session management with model storage.

2018-01-07 Thread D Jayachandran
Thanks Maxim, I will check and contribute accordingly.

Regards,
DJ

From: Maxim Orlov [mailto:ma...@cloudify.co]
Sent: Thursday, January 04, 2018 3:08 PM
To: D Jayachandran <d.jayachand...@ericsson.com>
Cc: dev@ariatosca.incubator.apache.org
Subject: Re: Database session management with model storage.

Well, the question is can we achieve the same functionality via the initiator 
to the model storage. Although it is initiated only once, using the 
sessionfactory with the initiator might help.
If not, it could be a great contribution to the project.

On Wed, Jan 3, 2018 at 7:50 AM D Jayachandran 
<d.jayachand...@ericsson.com<mailto:d.jayachand...@ericsson.com>> wrote:
Hi All,

Currently ARIA functions as a single threaded application particularly with the 
session management. The sql_mapi does not get the session and engine on a 
thread local basis.
We feel it is necessary to make changes in session management to effectively 
support multithreading  scenarios.
If all agree we can contribute on this.

Regards,
DJ
-Original Message-
From: D Jayachandran
Sent: Friday, December 29, 2017 12:01 PM
To: 
dev@ariatosca.incubator.apache.org<mailto:dev@ariatosca.incubator.apache.org>; 
Maxim Orlov <ma...@cloudify.co<mailto:ma...@cloudify.co>>
Subject: RE: Database session management with model storage.

Hi Tal,

More than the database used, I was referring on how the model storage is being 
initialized and exposed.
The sqlalchemy has by its own a sessionfactory and a scopesession to have 
sessions being exposed as thread local.
But With ARIA I feel this is not properly utilized as it is initialized the 
ModelStorage only once.

Please find the below code snippet from env.py where the model storage is 
initialized.
@property
def model_storage(self):
if not self._model_storage:
self._model_storage = self._init_sqlite_model_storage()
return self._model_storage


Regards,
DJ
-Original Message-
From: Tal Liron [mailto:t...@cloudify.co<mailto:t...@cloudify.co>]
Sent: Friday, December 29, 2017 11:41 AM
To: 
dev@ariatosca.incubator.apache.org<mailto:dev@ariatosca.incubator.apache.org>; 
Maxim Orlov <ma...@cloudify.co<mailto:ma...@cloudify.co>>
Subject: Re: Database session management with model storage.

The default storage, SQLite, has certain concurrency limitations, but if you 
use a more robust server (MySQL, Postresql) there should be no issues.

Maxim, any thoughts?

On Fri, Dec 29, 2017 at 12:01 AM, D Jayachandran < 
d.jayachand...@ericsson.com<mailto:d.jayachand...@ericsson.com>> wrote:

> Hi,
>
> We have built a REST Interface on top of ARIA. With the current
> implementation of ARIA, the "model storage" is seen as a singleton
> class, thereby the database session is also restricted to a single session.
> By exposing ARIA over REST, In a multithreaded scenario we are ending
> up in having the same database session over multiple threads. This
> will bring about issues during various db related actions across multiple 
> requests.
>
> ARIA being a CLI at this moment will not have any issues with this
> approach but to be used and exposed over other interfaces it will be a
> challenge.
> Please let us know if the session management can be handled properly
> with the model storage ? Do you already have any plans to work on this
> item or kindly provide your feedback on this issue.
>
>
> Regards,
> DJ
>


Re: Database session management with model storage.

2018-01-04 Thread Maxim Orlov
Well, the question is can we achieve the same functionality via the
initiator to the model storage. Although it is initiated only once, using
the sessionfactory with the initiator might help.
If not, it could be a great contribution to the project.

On Wed, Jan 3, 2018 at 7:50 AM D Jayachandran <d.jayachand...@ericsson.com>
wrote:

> Hi All,
>
> Currently ARIA functions as a single threaded application particularly
> with the session management. The sql_mapi does not get the session and
> engine on a thread local basis.
> We feel it is necessary to make changes in session management to
> effectively support multithreading  scenarios.
> If all agree we can contribute on this.
>
> Regards,
> DJ
> -Original Message-
> From: D Jayachandran
> Sent: Friday, December 29, 2017 12:01 PM
> To: dev@ariatosca.incubator.apache.org; Maxim Orlov <ma...@cloudify.co>
> Subject: RE: Database session management with model storage.
>
> Hi Tal,
>
> More than the database used, I was referring on how the model storage is
> being initialized and exposed.
> The sqlalchemy has by its own a sessionfactory and a scopesession to have
> sessions being exposed as thread local.
> But With ARIA I feel this is not properly utilized as it is initialized
> the ModelStorage only once.
>
> Please find the below code snippet from env.py where the model storage is
> initialized.
> @property
> def model_storage(self):
> if not self._model_storage:
> self._model_storage = self._init_sqlite_model_storage()
> return self._model_storage
>
>
> Regards,
> DJ
> -Original Message-
> From: Tal Liron [mailto:t...@cloudify.co]
> Sent: Friday, December 29, 2017 11:41 AM
> To: dev@ariatosca.incubator.apache.org; Maxim Orlov <ma...@cloudify.co>
> Subject: Re: Database session management with model storage.
>
> The default storage, SQLite, has certain concurrency limitations, but if
> you use a more robust server (MySQL, Postresql) there should be no issues.
>
> Maxim, any thoughts?
>
> On Fri, Dec 29, 2017 at 12:01 AM, D Jayachandran <
> d.jayachand...@ericsson.com> wrote:
>
> > Hi,
> >
> > We have built a REST Interface on top of ARIA. With the current
> > implementation of ARIA, the "model storage" is seen as a singleton
> > class, thereby the database session is also restricted to a single
> session.
> > By exposing ARIA over REST, In a multithreaded scenario we are ending
> > up in having the same database session over multiple threads. This
> > will bring about issues during various db related actions across
> multiple requests.
> >
> > ARIA being a CLI at this moment will not have any issues with this
> > approach but to be used and exposed over other interfaces it will be a
> > challenge.
> > Please let us know if the session management can be handled properly
> > with the model storage ? Do you already have any plans to work on this
> > item or kindly provide your feedback on this issue.
> >
> >
> > Regards,
> > DJ
> >
>


RE: Database session management with model storage.

2018-01-02 Thread D Jayachandran
Hi All,

Currently ARIA functions as a single threaded application particularly with the 
session management. The sql_mapi does not get the session and engine on a 
thread local basis.
We feel it is necessary to make changes in session management to effectively 
support multithreading  scenarios. 
If all agree we can contribute on this.

Regards,
DJ 
-Original Message-
From: D Jayachandran 
Sent: Friday, December 29, 2017 12:01 PM
To: dev@ariatosca.incubator.apache.org; Maxim Orlov <ma...@cloudify.co>
Subject: RE: Database session management with model storage.

Hi Tal,

More than the database used, I was referring on how the model storage is being 
initialized and exposed.
The sqlalchemy has by its own a sessionfactory and a scopesession to have 
sessions being exposed as thread local. 
But With ARIA I feel this is not properly utilized as it is initialized the 
ModelStorage only once. 

Please find the below code snippet from env.py where the model storage is 
initialized.
@property
def model_storage(self):
if not self._model_storage:
self._model_storage = self._init_sqlite_model_storage()
return self._model_storage


Regards,
DJ
-Original Message-
From: Tal Liron [mailto:t...@cloudify.co]
Sent: Friday, December 29, 2017 11:41 AM
To: dev@ariatosca.incubator.apache.org; Maxim Orlov <ma...@cloudify.co>
Subject: Re: Database session management with model storage.

The default storage, SQLite, has certain concurrency limitations, but if you 
use a more robust server (MySQL, Postresql) there should be no issues.

Maxim, any thoughts?

On Fri, Dec 29, 2017 at 12:01 AM, D Jayachandran < d.jayachand...@ericsson.com> 
wrote:

> Hi,
>
> We have built a REST Interface on top of ARIA. With the current 
> implementation of ARIA, the "model storage" is seen as a singleton 
> class, thereby the database session is also restricted to a single session.
> By exposing ARIA over REST, In a multithreaded scenario we are ending 
> up in having the same database session over multiple threads. This 
> will bring about issues during various db related actions across multiple 
> requests.
>
> ARIA being a CLI at this moment will not have any issues with this 
> approach but to be used and exposed over other interfaces it will be a 
> challenge.
> Please let us know if the session management can be handled properly 
> with the model storage ? Do you already have any plans to work on this 
> item or kindly provide your feedback on this issue.
>
>
> Regards,
> DJ
>


RE: Database session management with model storage.

2017-12-28 Thread D Jayachandran
Hi Tal,

More than the database used, I was referring on how the model storage is being 
initialized and exposed.
The sqlalchemy has by its own a sessionfactory and a scopesession to have 
sessions being exposed as thread local. 
But With ARIA I feel this is not properly utilized as it is initialized the 
ModelStorage only once. 

Please find the below code snippet from env.py where the model storage is 
initialized.
@property
def model_storage(self):
if not self._model_storage:
self._model_storage = self._init_sqlite_model_storage()
return self._model_storage


Regards,
DJ
-Original Message-
From: Tal Liron [mailto:t...@cloudify.co] 
Sent: Friday, December 29, 2017 11:41 AM
To: dev@ariatosca.incubator.apache.org; Maxim Orlov <ma...@cloudify.co>
Subject: Re: Database session management with model storage.

The default storage, SQLite, has certain concurrency limitations, but if you 
use a more robust server (MySQL, Postresql) there should be no issues.

Maxim, any thoughts?

On Fri, Dec 29, 2017 at 12:01 AM, D Jayachandran < d.jayachand...@ericsson.com> 
wrote:

> Hi,
>
> We have built a REST Interface on top of ARIA. With the current 
> implementation of ARIA, the "model storage" is seen as a singleton 
> class, thereby the database session is also restricted to a single session.
> By exposing ARIA over REST, In a multithreaded scenario we are ending 
> up in having the same database session over multiple threads. This 
> will bring about issues during various db related actions across multiple 
> requests.
>
> ARIA being a CLI at this moment will not have any issues with this 
> approach but to be used and exposed over other interfaces it will be a 
> challenge.
> Please let us know if the session management can be handled properly 
> with the model storage ? Do you already have any plans to work on this 
> item or kindly provide your feedback on this issue.
>
>
> Regards,
> DJ
>


Re: Database session management with model storage.

2017-12-28 Thread Tal Liron
The default storage, SQLite, has certain concurrency limitations, but if
you use a more robust server (MySQL, Postresql) there should be no issues.

Maxim, any thoughts?

On Fri, Dec 29, 2017 at 12:01 AM, D Jayachandran <
d.jayachand...@ericsson.com> wrote:

> Hi,
>
> We have built a REST Interface on top of ARIA. With the current
> implementation of ARIA, the "model storage" is seen as a singleton class,
> thereby the database session is also restricted to a single session.
> By exposing ARIA over REST, In a multithreaded scenario we are ending up
> in having the same database session over multiple threads. This will bring
> about issues during various db related actions across multiple requests.
>
> ARIA being a CLI at this moment will not have any issues with this
> approach but to be used and exposed over other interfaces it will be a
> challenge.
> Please let us know if the session management can be handled properly with
> the model storage ? Do you already have any plans to work on this item or
> kindly provide your feedback on this issue.
>
>
> Regards,
> DJ
>


Database session management with model storage.

2017-12-28 Thread D Jayachandran
Hi,

We have built a REST Interface on top of ARIA. With the current implementation 
of ARIA, the "model storage" is seen as a singleton class, thereby the database 
session is also restricted to a single session.
By exposing ARIA over REST, In a multithreaded scenario we are ending up in 
having the same database session over multiple threads. This will bring about 
issues during various db related actions across multiple requests.

ARIA being a CLI at this moment will not have any issues with this approach but 
to be used and exposed over other interfaces it will be a challenge.
Please let us know if the session management can be handled properly with the 
model storage ? Do you already have any plans to work on this item or kindly 
provide your feedback on this issue.


Regards,
DJ