[web2py] Re: concurrency problem

2010-04-05 Thread mdipierro
ERRATA: You can already chain them onvalidation=lambda form: (f1(form),f2(form),f3(form)) On Apr 5, 10:34 am, mdipierro wrote: > You can already chain them > > onvalidate=lambda form: (f1(form),f2(form),f3(form)) > > On Apr 5, 1:14 am, Iceberg wrote: > > > Good to hear that is on your todo lis

[web2py] Re: concurrency problem

2010-04-05 Thread mdipierro
You can already chain them onvalidate=lambda form: (f1(form),f2(form),f3(form)) On Apr 5, 1:14 am, Iceberg wrote: > Good to hear that is on your todo list, Massimo. When you do that, > please also figure out a way to chain multi onvalidate functions, > because I expect the crud.unmodified() woul

Re: [web2py] Re: concurrency problem

2010-04-05 Thread Vasile Ermicioi
that is an idea! it will be great if web2py will do what sqlalchemy does http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/pooling.html#sqlalchemy.pool.SingletonThreadPool -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this grou

[web2py] Re: concurrency problem

2010-04-05 Thread Sven
First of all I agree. I can just as well use a full-feature db and I have migrated to postgresql. I was just curious if it was possible/sensible to solve the problem without changing database or my application code; in other words let web2py do it for me. I guess the answer is no ;) Sven -- You

[web2py] Re: concurrency problem

2010-04-04 Thread Iceberg
Good to hear that is on your todo list, Massimo. When you do that, please also figure out a way to chain multi onvalidate functions, because I expect the crud.unmodified() would be used quite popular, if not everytime. Iceberg On Apr5, 1:42pm, mdipierro wrote: > This is a good point. I do not t

[web2py] Re: concurrency problem

2010-04-04 Thread mdipierro
This is a good point. I do not think this should be dealt with at the DB level because, if I understand it is an app workflow problem. If I understand For every user there are two HTTP requests (one to generate the update form, one to submit the form) and each is executed in its own transactio

[web2py] Re: concurrency problem

2010-04-04 Thread Iceberg
Yarko, you suggest using a full-featured db instead of sqlite. But sqlite's internal reader/writer lock is one thing, the "overwrite" problem is another. No matter what kind of db we are using, we still need to deal with the "overwrite" problem. Scenario: 9:00am clerk Adam read the balance of a cl

[web2py] Re: concurrency problem

2010-04-04 Thread Yarko Tymciurak
On Apr 4, 5:04 am, Sven wrote: > Thanks for your thoughts. > > @Yarko the locking code snippet seems useful. In this case, however, > my users never updated the same record. The problem was the locking of > the complete database each time two users updated or created 'their > own' records. > > @Be

[web2py] Re: concurrency problem

2010-04-04 Thread Sven
Thanks for your thoughts. @Yarko the locking code snippet seems useful. In this case, however, my users never updated the same record. The problem was the locking of the complete database each time two users updated or created 'their own' records. @Beerc PostgreSQL did the trick, thanks :) The s

[web2py] Re: concurrency problem

2010-04-03 Thread mdipierro
> 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

[web2py] Re: concurrency problem

2010-04-03 Thread Iceberg
Yarko, you also raise a very good point. And this makes me feel nervous, because all my previous web app are vulnerable to this "overwrite" issue. :-/ Besides the "locking" plugin, which is optional and not aware by everyone, do you think we can add some built-in, anti-overwrite protection inside

[web2py] Re: concurrency problem

2010-04-03 Thread Iceberg
I also use web2py and sqlite in my low traffic website, serving for less than 10 people. In most cases it works great. But when a user wants to open a statistics page which generated by a query of thousands of records (and then rendered as 7 flash charts), there is a 5%~10% chance that the browser

[web2py] Re: concurrency problem

2010-04-02 Thread Yarko Tymciurak
The first thing I thought of when I read your post was this: http://web2py.com/plugins/default/locking and I wondered how you implemented your solution. I could imagine, if two users open a form, and both submit form.id 2, one will "overwrite" the other's. (hope this is helpful) Regards, - Yarko

[web2py] Re: concurrency problem

2010-04-02 Thread Beerc
This problem is definitely at Sqlite level. "Everything seems to be all right when I test it" == single user "but with as few as 2 simultaneous users I (sometimes) run into trouble" == database locked by transaction Sqlite has no problems with concurrency, it is a simple, fast, very high quality

[web2py] Re: concurrency problem

2010-04-02 Thread Beerc
See http://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