Can write to database using API but get an error on writing with sqlite3.exe

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Can write to database using API but get an error on writing with sqlite3.exe

Luiz Américo
I have a 1GB database configured to use WAL mode.

It's accessed by short lived CGI processes, under windows 2008 server. Each
process usually opens the database, execute a select or update/insert,
close the connection and finishes. It uses c api
(sqlite3_open, sqlite3_prepare, sqlite3_step) of dll downloaded from
sqlite.org.

All operations are working fine (reading, writing to the database). Those
processes are started ~1 to 5 per second

There's a ~5MB wal and shm file that are being updated frequently

When i open the same database with sqlite3.exe (or an external tool like
Sqlite Expert) i can do read commands (select), but when i try to write to
database (UPDATE / ALTER TABLE) it gives a "Attempt to write a read only
database" error.

The tools are executed in the same machine as the datafile

If i try to open a (smaller, less accessed) database in the same folder as
the main one all writing operations are allowed in the external tools

Any hints on what's going on?

Luiz
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can write to database using API but get an error on writing with sqlite3.exe

Keith Medcalf

Have you checked to make sure the ID that you are using (interactively) is permitted read/write access to the directory containing the db files and to the files themselves?  I mean *actually* checked that you have permission, since I doubt that the CGI process is running with the same ID you are using to logon.

---
The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume.


>-----Original Message-----
>From: sqlite-users [mailto:sqlite-users-
>[hidden email]] On Behalf Of Luiz Américo
>Sent: Wednesday, 26 September, 2018 20:05
>To: General Discussion of SQLite Database
>Subject: [sqlite] Can write to database using API but get an error on
>writing with sqlite3.exe
>
>I have a 1GB database configured to use WAL mode.
>
>It's accessed by short lived CGI processes, under windows 2008
>server. Each
>process usually opens the database, execute a select or
>update/insert,
>close the connection and finishes. It uses c api
>(sqlite3_open, sqlite3_prepare, sqlite3_step) of dll downloaded from
>sqlite.org.
>
>All operations are working fine (reading, writing to the database).
>Those
>processes are started ~1 to 5 per second
>
>There's a ~5MB wal and shm file that are being updated frequently
>
>When i open the same database with sqlite3.exe (or an external tool
>like
>Sqlite Expert) i can do read commands (select), but when i try to
>write to
>database (UPDATE / ALTER TABLE) it gives a "Attempt to write a read
>only
>database" error.
>
>The tools are executed in the same machine as the datafile
>
>If i try to open a (smaller, less accessed) database in the same
>folder as
>the main one all writing operations are allowed in the external tools
>
>Any hints on what's going on?
>
>Luiz
>_______________________________________________
>sqlite-users mailing list
>[hidden email]
>http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can write to database using API but get an error on writing with sqlite3.exe

Luiz Américo
Em qui, 27 de set de 2018 às 00:30, Keith Medcalf <[hidden email]>
escreveu:

>
> Have you checked to make sure the ID that you are using (interactively) is
> permitted read/write access to the directory containing the db files and to
> the files themselves?  I mean *actually* checked that you have permission,
> since I doubt that the CGI process is running with the same ID you are
> using to logon.
>
>
Good call. I will check but i can write another database file located in
the same directory with external tools. The difference of this second db is
that is a lot smaller, is not accessed frequently and don't have wal shm
files (not sure what is the lock mode)

Luiz
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Can write to database using API but get an error on writing with sqlite3.exe

Luiz Américo
Em qui, 27 de set de 2018 às 00:59, Luiz Américo <[hidden email]>
escreveu:

>
>
> Em qui, 27 de set de 2018 às 00:30, Keith Medcalf <[hidden email]>
> escreveu:
>
>>
>> Have you checked to make sure the ID that you are using (interactively)
>> is permitted read/write access to the directory containing the db files and
>> to the files themselves?  I mean *actually* checked that you have
>> permission, since I doubt that the CGI process is running with the same ID
>> you are using to logon.
>>
>>
> Good call. I will check
>


That was the problem. I executed the external app with admin privileges and
worked

Many thanks

Luiz

>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users