Is the hosting company running linux or windows? You say .net so that
indicates to me windows, but I've been wrong before. (Wife lets me know
frequently. {smirk})
This still "smells" like a permission issue to me. I acknowledge that
you're able to read/write/modify the web files then upload them, but the
user who is serving the pages to the web clients may not have WRITE
permissions to the directory where the web pages are hosted. I don't
know exactly how you upload your pages to your site, but via FTP, or
Samba, a specialized web interface, or whatever, you're typically
provided with a username and password to log in. However, the "user"
that actually reads and writes to that directory that hosts the data to
the web CLIENTS is typically the web service. Can't think of the user
for windows (iisadmin? iisuser? Something like that anyways), but for
linux it is usually either the user "httpd" or "apache2". If the users
"httpd" or "apache2" don't have WRITE access to that directory, you
could have problems. The SQLite engine may need to create a temporary
file. If the temp file can't be written, it may throw an exception
which is why you're getting the error.
Depending on your site provider, you may have a "public" directory where
all your web pages live, then a "private" directory where other stuff
sits, like databases. The PUBLIC directory may be locked down by
default so that nothing via the web interface can modify files,
including writing to your SQLite database, and a private place that
anyone can write to. Try moving your database into a private directory,
set your application to open the directory from there, and see what happens.
SQLite doesn't have any problem hosting a database for web applications
for light to medium use, according to documentation. Which means you're
not going to run a Google-ish size of site, nor even EBay, but, it
should be able to handle something like forums, wikis, and so on. If
you're going to start using MS-Access for your database back end, I
*KNOW* you're not going to towards a Google-ish size of site.
On 01/29/2012 06:54 AM, Shahar Weinstein wrote:
thanks for your reply.
since my situation IS one process that tries to write to the database, I'm
trying to use the forums help.
if the situation was multiple processes as you described I would move to
mysql or MSaccess database which is quite stable for web applications.
I've programmed few web projects with the sqlite database which never had
this problem.
and those projects are running well, that's why I think I've got a special
situation.
it seems I will, have to move to another database.
thanks
Shahar.
2012/1/29 Jan Hudec<b...@ucw.cz>
On Sun, Jan 29, 2012 at 12:57:21 +0200, Shahar Weinstein wrote:
I don't think that the TMP folder is the right direction but I'll check
it
anyway with the hosting company.
No, *NOT* *HOSTING* *COMPANY*. Your code.
I agree it's probably not the right direction though.
besides that, I do know that there is only one process running that tries
to write to the database what makes my situation a sad joke. sqlite
supposed to be a strong database that knows how to deal such simple
situations.
So you are saying, that there is absolutely no other client using the code
at
the same time or even that the same client isn't using two windows? Because
otherwise any serious web server will run mutliple instances of your code
in
either multiple threads or multiple processes.
even of 2 processes that tries to write to the database the same time,
else
it's probably a very weak database system that doesn't have transactions
locks mechanism inside.
It DOES. But very coarse-grained and is telling you the one process has it
locked, so the other process can't access it.
Sqlite is designed to be lightweight. The cost for this is, that it does
not
have per-row or per-table locks. A write transactions always needs to lock
the whole database. Additionally by default when the database is locked,
the
operation immediately fails with the "database is locked" error you are
seeing.
You need to do three things:
- Run 'PRAGMA journal=wal' on the database once (see
http://www.sqlite.org/wal.html). This requires sqlite at least 3.7.0.
- Set the timeout, so the operations wait for the other process to finish
for some time instead of failing. The C-level API is sqlite3_busy_timeout
(http://www.sqlite.org/c3ref/busy_timeout.html). The .NET api will be
called similar.
- Plan eventual migration to SQL Server or MySQL or something, because
sqlite will not scale. It's designed to be fast for data processing and
small so it can be embedded in desktop or even mobile applications, but
that means it does not support multiple servers and parallel
transactions.
It can work fine in web app that gets at most few hits a minute, but for
higher load you will definitiely need a database server.
--
Jan 'Bulb' Hudec<
b...@ucw.cz>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users