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 <[email protected]> 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: [email protected]; Maxim Orlov <[email protected]> > 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:[email protected]] > Sent: Friday, December 29, 2017 11:41 AM > To: [email protected]; Maxim Orlov <[email protected]> > 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 < > [email protected]> 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 > > >
