On Apr 4, 5:04 am, Sven <[email protected]> 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.
>
> @Beerc PostgreSQL did the trick, thanks :)
>
> The sqlite docs suggest, however, that it should be possible to have
> small multi-user applications using sqlite. I mean, a few users
> reading/writing each 20/30 seconds does not have to be a  problem if
> each request locks the database  for x milliseconds. I just
> incorrectly assumed that handling occasional locks would have been
> handled somehow by the DAL.

This (data concurrency / data safety of a database server) belongs
with the db, not with the applicaition using it.
IF the application using a db implements this, then db becomes
(effectively) part of the applicaiton.

About sqlite:   why insist using it?   It is _intentionally_ a light-
weight db, used most significantly in embedded contexts (i.e. your
cell phone configuration most likely uses sqlite  - no multi-user
model needed / wanted).

TWO questions:   have you tried an executesql to send "SQLITE CONFIG
SERIALIZED"?   I would try this first _if_ you really have some
pertinent, significant situation preventing use of a different
database engine.

Second:  please consider solving your problem by using a full-feature
db, such as postgres.   This is really the path that (to my eyes)
makes the most sense.

- Yarko

>
> Just a thought (don't know if it makes sense): what about implementing
> a simple sqlite lock handling mechanism into DAL? For example retry to
> read/write the sqlite database a few times before giving up. Don't
> know if that's the best approach, but it might have solved my problem
> (possibly reduce cebergs  5-10% no content problem too) and
> fascilitate small multi-user projects with web2py+sqlite. I feel a few
> multi-user writes in 30 seconds should not require me to adopt a full
> relational database (unnecessary memory footprint for my small
> project) or writing this lock handling code myself specifically for
> sqlite (removing some of the advantage for using DAL and sqlite out of
> the box; one of the reasons to use web2py in the first place).
>
> On the other hand installing postgreSQL was easy enough and it's great
> that I only needed to change 1 line of code in my web2py
> application :)
>
> -Sven

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

Reply via email to