> Further more, at the end of this post (http://www.sqlite.org/
> whentouse.html), it mentions sqlite uses reader/writer lock. So here
> comes my first question, perhaps mainly for Massimo: When a user click
> on our web2py app which contains a db=SQLDB("sqlite://mydb.sqlite"),
> does that mean we already open the db, create a transaction, therefore
> the whole sqlite db is locked by writer lock, until the current user
> request is finished?

Yes

> If so, that means even two crud.read() request
> can not be served at the same time.

True. They will be serialized in sqlite.

> By the way, this post (http://www.sqlite.org/threadsafe.html) mentions
> three thread modes of sqlite. Do you know which mode is python 's
> built-in sqlite uses? Is it the "default Serialized mode"? If so, that
> means even two crud.read() request can not be served at the same time.

I think that is it.

> Thanks in advance for any feedback.
>
> Sincerely,
> Iceberg
>
> On Apr2, 7:50pm, Beerc <berces.las...@fomi.hu> wrote:
>
> > Seehttp://stackoverflow.com/questions/54998/how-scalable-is-sqlite
>
> > [...] there is nothing that prevents using an Sqlite database in a
> > multi-user environment, but every transaction (in effect, every SQL
> > statement that modifies the database) takes a lock on the file, which
> > will prevent other users from accessing the database at all.
>
> > So if you have lots of modifications done to the database, you're
> > essentially going to hit scaling problems very quick. If, on the other
> > hand, you have lots of read access compared to write access, it might
> > not be so bad.
>
> > On Apr 2, 12:00 pm, Sven <svenstrin...@gmail.com> wrote:
>
> > > Hi,
>
> > > I programmed a psychological experiment in flash and store answers/
> > > results in a sqlite database using web2py (behind  nginx server +
> > > fastcgi)  and pyamf. Everything seems to be all right when I test it,
> > > but with as few as 2 simultaneous users I (sometimes) run into
> > > trouble. A try with seven simultaneous users resulted in only 2
> > > succesfully stored experimental data.sets
> > > I find it very hard to debug, since there are no tickets in web2py.
> > > Flash does sometimes produce a remoting error in that situation, but
> > > without too much information.
>
> > > I seems to me there is some kind of concurrency problem, but I assumed
> > > web2py/sqlite would take care of that for me. Or should I explicitly
> > > deal with this? Explicitly commit, check if inserts and updates were
> > > successful and if not try again?
>
> > > Any suggestions, comments ideas would be really appreciated.
>
> > > Thanks.
>
> > > Sven

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to