Re: [sqlite] Any way to debug which query/connection is holding a share lock?

2014-06-13 Thread Sohail Somani

On 13/06/2014 4:38 PM, RSmith wrote:

If none of these finds you a culprit, it means your program is the only
thing left to blame. Here we need to start with logging every time you
create a connection and start a query or creating a prepared statement.
Log the handles or object IDs you get back from any call too. Compare
these to the logs when you reset or close the statements and when you
free the statements and the DB connection. Go through these with a
fine-tooth comb, make sure every resource made is linked to a release in
the correct order.


I think I'm pretty certain that my program *is* the culprit. I'd like to 
add the tracing to SQLite itself. Which functions do you suggest? I know 
you mentioned opening/closing so that would be sqlite3_open* and 
sqlite3_finalize?


Just to clarify, this is all happening within one process:

Write thread: write
Read thread: read something
Write thread: write
Write thread: write
Read thread: read something <-- this is a "special" query but I can't 
see anything special about it except that it uses FTS

Write thread: hang until app exits

Also, I tried using sqlite3_config to add logging but that didn't seem 
to do much. Time for some printfs...


Sohail

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Segfault in sqlite3DbMallocRaw

2014-06-13 Thread Richard Hipp
On Fri, Jun 13, 2014 at 6:08 PM, Maxim Khitrov  wrote:

> Hi all,
>
> I don't think this is a problem with sqlite, but I'm also not sure
> what external behavior could trigger this, so I'm looking for help
> from someone more familiar with the sqlite internals.
>
> One of the users of my SQLite binding for Go is reporting a
> non-deterministic segfault in the 3.8.5 amalgamation on line 20086,
> which is "db->lookaside.pFree = pBuf->pNext;" in sqlite3DbMallocRaw:
>
> https://github.com/mxk/go-sqlite/issues/6
>
> The segfault always seems to happen at the same place, but it happens
> infrequently, and the actual call sequence may be different. There
> don't seem to be any concurrent calls to any sqlite functions, yet
> building the package with either SQLITE_THREADSAFE=1 (instead of 2) or
> SQLITE_OMIT_LOOKASIDE resolves, or maybe just hides the issue.
>
> This feels like a concurrency problem, but I can't reproduce it or
> figure out the source. Is it possible to corrupt the lookaside
> allocator in some other way?
>

I recommend compiling with -DSQLITE_OMIT_LOOKASIDE and then running your
test in valgrind (or the equivalent).  That will very likely find the
problem.

I'm guessing this is a use-after-free issue.


-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Segfault in sqlite3DbMallocRaw

2014-06-13 Thread Maxim Khitrov
Hi all,

I don't think this is a problem with sqlite, but I'm also not sure
what external behavior could trigger this, so I'm looking for help
from someone more familiar with the sqlite internals.

One of the users of my SQLite binding for Go is reporting a
non-deterministic segfault in the 3.8.5 amalgamation on line 20086,
which is "db->lookaside.pFree = pBuf->pNext;" in sqlite3DbMallocRaw:

https://github.com/mxk/go-sqlite/issues/6

The segfault always seems to happen at the same place, but it happens
infrequently, and the actual call sequence may be different. There
don't seem to be any concurrent calls to any sqlite functions, yet
building the package with either SQLITE_THREADSAFE=1 (instead of 2) or
SQLITE_OMIT_LOOKASIDE resolves, or maybe just hides the issue.

This feels like a concurrency problem, but I can't reproduce it or
figure out the source. Is it possible to corrupt the lookaside
allocator in some other way?

- Max
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite failing in Windows 7

2014-06-13 Thread Calvert, Jim
Joe, thanks for the idea.  I did contact them about the version being old
but no response yet.
Cheers
Jim

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Joe Mistachkin
Sent: June 13, 2014 4:07 PM
To: 'General Discussion of SQLite Database'
Subject: Re: [sqlite] System.Data.SQLite failing in Windows 7


Calvert, Jim wrote:
> 
> Is there anybody from the developers of SQLite who can comment on this
issue
> for me.
> 

I did reply to your original post.  Here is a link to the thread:

http://www.mail-archive.com/sqlite-users%40sqlite.org/msg84247.html
 
--
Joe Mistachkin

___
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


Re: [sqlite] Any way to debug which query/connection is holding a share lock?

2014-06-13 Thread RSmith


On 2014/06/13 17:38, Sohail Somani wrote:


Thanks for your response. I had been trying to avoid the "writing little bits" over time to avoid an inconsistent state in the 
case of a crash or user exit, but the inconsistency is not that big of a deal as the data integrity is still there and eventually, 
it becomes consistent. So this solution is not the end of the world.


I actually don't have a problem with readers or writers waiting, but the problem that I am having is something holds on to the 
read lock well beyond where it should. I cannot figure out who (I suspect it's a third-party framework) and what I'd like to do is 
figure out what piece of code is refusing to relinquish the lock regardless of the eventual strategy I take. Even if I ended up 
doing everything in the same thread, with piecemeal updates, this means that there is still something, somewhere doing the wrong 
thing and I think that will probably end up biting me in an unwelcome place.


So rather than actually solve the problem, I'm looking to find the source of 
the problem. Does that make sense?

For what it's worth, I did rewire the code to do everything in one thread, with piecemeal writes and it works fine, but is not a 
good solution as far as I am concerned because it is just papering over the actual problem.




Apologies, did not get this from your original post, and you are right, piecemeal is not the best way, and it seems is not necessary 
if you do actually find the culprit that holds the read-lock way past necessary.  As for finding the culprit, are there any apps 
other than your own that uses the Database? (You seem to suggest there might be if I am interpreting it correctly).


If there are, then simply stop them and test the system, start them one by one until the error happens. You did not mention the 
operating system so I cannot suggest much there other to say that some OSes might add external locks on a file, such as when the 
file is in a protected area in Windows UAC, or in a root area and you are not a superuser or administrator and one of the threads 
reading/writing is not "cleared" by the UAC or whatever other system marshal, or maybe a virus scanner is trying to assess the file 
after it changes, making sure no naughty stuff were injected - some of them hold the read lock a while because they slowly chew 
through the file to avoid hogging system resources - very clever, but a pain to wait for.


If none of these finds you a culprit, it means your program is the only thing left to blame. Here we need to start with logging 
every time you create a connection and start a query or creating a prepared statement. Log the handles or object IDs you get back 
from any call too. Compare these to the logs when you reset or close the statements and when you free the statements and the DB 
connection. Go through these with a fine-tooth comb, make sure every resource made is linked to a release in the correct order.


If it still eludes you, try to use Valgrind or something you are familiar with - make sure the compiler errors are strict or 
complete or throwing exceptions on all errors (or whatever that sort of thing is called in your development platform).


One thing is certain - It isn't magic, there is a real reason for the lock and 
it must be something traceable.


"Bad Programmers add corrective code.  Good programmers remove defective code."


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite failing in Windows 7

2014-06-13 Thread Akintoye Olorode (BLOOMBERG/ 731 LEX -)
That error likely implies that your .NET assembly is corrupted.
 
After you observe the error, can you attempt loading your version of 
System.Data.SQLite.dll in ildasm.exe ? If you are not certain of the file on 
disk from which Assembly is being loaded, run Fuslogvw.exe to generate the 
binding logs.

- Akintoye

From: jwcalv...@rogers.com At: Jun 13 2014 14:22:16
To: jwcalv...@rogers.com, sqlite-users@sqlite.org
Subject: Re: [sqlite] System.Data.SQLite failing in Windows 7

Everyone,

Is there anybody from the developers of SQLite who can comment on this issue
for me.

Thanks

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Calvert, Jim
Sent: June 12, 2014 11:46 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] System.Data.SQLite failing in Windows 7

Hi everyone,

 

I have run into a very baffling issue with System.Data.SQLite.

It is running on my Windows 7 PC as part of a utility which sync's data on
my iPhone and iPad with MS Outlook.

It is fully up-to-date as Win 7 64 bit SP1.

 

Suddenly 2 weeks ago it began to fail with the following message:

 

"Could not load file or assembly 'System.Data.SQLite, Version=1.0.66.0,

Culture neutral, PublicKeyToken=db937bc2d44ff139' or one of its
dependencies.  

The module was expected to contain assembly manifest."

 

I have re-installed the Win 7 app multiple times.

I have re-installed System.Data.SQLite itself multiple times.

I have updated every possible MS redistributable.

I have run out of ideas and I am probably missing something really simple.

 

So, I need some clues as to where to look.

 

All ideas are welcome as I like this particular app and there are not any
good alternatives.

 

Thanks

 

___
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


Re: [sqlite] System.Data.SQLite failing in Windows 7

2014-06-13 Thread Joe Mistachkin

Calvert, Jim wrote:
> 
> Is there anybody from the developers of SQLite who can comment on this
issue
> for me.
> 

I did reply to your original post.  Here is a link to the thread:

http://www.mail-archive.com/sqlite-users%40sqlite.org/msg84247.html
 
--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite failing in Windows 7

2014-06-13 Thread Simon Slavin

> On 13 Jun 2014, at 7:22pm, Calvert, Jim  wrote:
> 
> Is there anybody from the developers of SQLite who can comment on this issue
> for me.

We saw your post.  No need to repeat it.  Your problem is not with SQLite and 
that's why we didn't answer.

Consult whoever wrote your MS Outlook synchronisation program.  This might help:



Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] System.Data.SQLite failing in Windows 7

2014-06-13 Thread Calvert, Jim
Everyone,

Is there anybody from the developers of SQLite who can comment on this issue
for me.

Thanks

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Calvert, Jim
Sent: June 12, 2014 11:46 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] System.Data.SQLite failing in Windows 7

Hi everyone,

 

I have run into a very baffling issue with System.Data.SQLite.

It is running on my Windows 7 PC as part of a utility which sync's data on
my iPhone and iPad with MS Outlook.

It is fully up-to-date as Win 7 64 bit SP1.

 

Suddenly 2 weeks ago it began to fail with the following message:

 

"Could not load file or assembly 'System.Data.SQLite, Version=1.0.66.0,

Culture neutral, PublicKeyToken=db937bc2d44ff139' or one of its
dependencies.  

The module was expected to contain assembly manifest."

 

I have re-installed the Win 7 app multiple times.

I have re-installed System.Data.SQLite itself multiple times.

I have updated every possible MS redistributable.

I have run out of ideas and I am probably missing something really simple.

 

So, I need some clues as to where to look.

 

All ideas are welcome as I like this particular app and there are not any
good alternatives.

 

Thanks

 

___
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


Re: [sqlite] lifetime of buffer referred to with SQLITE_STATIC

2014-06-13 Thread Igor Tandetnik

On 6/13/2014 1:27 PM, Richard Hipp wrote:

On Fri, Jun 13, 2014 at 1:20 PM, Eric Rubin-Smith  wrote:


If I say sqlite_bind_text(...SQLITE_STATIC), I am promising that the buffer
is going to stick around for a while.  How long am I promising that it will
stick around?  Til the next statement reset()?  Til the statement
finalize()?  Til the database close()?



Until the parameter you are binding against cannot long be used.  Which
will be either (1) sqlite3_reset() or (2) sqlite3_finalize() or (3) the
next sqlite3_bind() against the same parameter, whichever comes first.


I believe it's possible, though unusual, to step, then reset, then step 
again without rebinding, at which point the previous parameter value 
will be used and must remain alive.


Perhaps something like this: the buffer must remain alive through any 
call to sqlite3_step that "uses" it. sqlite3_step uses the buffer if a) 
it was bound to a parameter by a prior sqlite3_bind_* call, and b) there 
was no intervening sqlite3_bind_* call for the same parameter, nor 
sqlite3_clear_bindings call.


As a corollary, the buffer is no longer needed after sqlite3_finalize, 
simply because it would not be possible to call sqlite3_step anymore on 
the finalized statement.

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] lifetime of buffer referred to with SQLITE_STATIC

2014-06-13 Thread Richard Hipp
On Fri, Jun 13, 2014 at 1:20 PM, Eric Rubin-Smith  wrote:

> If I say sqlite_bind_text(...SQLITE_STATIC), I am promising that the buffer
> is going to stick around for a while.  How long am I promising that it will
> stick around?  Til the next statement reset()?  Til the statement
> finalize()?  Til the database close()?
>

Until the parameter you are binding against cannot long be used.  Which
will be either (1) sqlite3_reset() or (2) sqlite3_finalize() or (3) the
next sqlite3_bind() against the same parameter, whichever comes first.



> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] lifetime of buffer referred to with SQLITE_STATIC

2014-06-13 Thread Stephan Beal
On Fri, Jun 13, 2014 at 7:20 PM, Eric Rubin-Smith  wrote:

> If I say sqlite_bind_text(...SQLITE_STATIC), I am promising that the buffer
> is going to stick around for a while.  How long am I promising that it will
> stick around?  Til the next statement reset()?  Til the statement
> finalize()?  Til the database close()?
>

Until the statement is done with that specific value. My rule of thumb is:
the bytes must outlive the step() call. After step(), the statement won't
do anything with those bytes (won't read/inspect them) because it has no
need to. i use SQLITE_STATIC quite a lot for non-static data (b/c copying
bytes for this type of thing pains me greatly), and the only guaranty i've
ever needed making is that the bytes outlive the step() which accesses them.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] lifetime of buffer referred to with SQLITE_STATIC

2014-06-13 Thread Eric Rubin-Smith
If I say sqlite_bind_text(...SQLITE_STATIC), I am promising that the buffer
is going to stick around for a while.  How long am I promising that it will
stick around?  Til the next statement reset()?  Til the statement
finalize()?  Til the database close()?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Any way to debug which query/connection is holding a share lock?

2014-06-13 Thread Sohail Somani

On 13/06/2014 11:04 AM, RSmith wrote:


On 2014/06/13 15:02, Sohail Somani wrote:


My application's architecture looks roughly like this:

- A main thread which does only database reads
- A dedicated database write thread

I needed to create this because while reads are fast, there are
occasions where writes take a significant portion of time and that can
cause the main thread to lock up, which results in a sub-par user
experience.


Let me pause right here. It doesn't matter which  thread is writing to
the DB in which Journal mode, the lock is because you cannot change the
state of Data in the DB "while other things are reading it". So whether
it is the same thread or another thread doesn't matter, the moment you
start writing to a DB, the readers have to wait.

There are Pragma settings able to change this behaviour, if you use
proper journal mode and cache-sharing settings in combination with
allowing uncomitted reads, BUT before we even point you to that
literature, let me ask whether it actually matters? In other words,
let's say you have a read operation that is scanning through the table,
would it matter if some of the records are more up-to-date than others?

If this doesn't matter then you might use the said Pragmas to achieve
it. If it /DOES/ matter, then you need to rethink the update concurrency
strategy - such as writing little bits over time in stead of big chunks
etc. (This is a recurring theme on here, so lots of people here, other
than me, are quite knowledgeable on that subject, but a lot more detail
about your strategy or problem is needed).

As to the literature on the said Pragmas, kindly see these links:

http://www.sqlite.org/pragma.html#pragma_read_uncommitted
http://www.sqlite.org/isolation.html
http://www.sqlite.org/sharedcache.html

Have a great day!


Thanks for your response. I had been trying to avoid the "writing little 
bits" over time to avoid an inconsistent state in the case of a crash or 
user exit, but the inconsistency is not that big of a deal as the data 
integrity is still there and eventually, it becomes consistent. So this 
solution is not the end of the world.


I actually don't have a problem with readers or writers waiting, but the 
problem that I am having is something holds on to the read lock well 
beyond where it should. I cannot figure out who (I suspect it's a 
third-party framework) and what I'd like to do is figure out what piece 
of code is refusing to relinquish the lock regardless of the eventual 
strategy I take. Even if I ended up doing everything in the same thread, 
with piecemeal updates, this means that there is still something, 
somewhere doing the wrong thing and I think that will probably end up 
biting me in an unwelcome place.


So rather than actually solve the problem, I'm looking to find the 
source of the problem. Does that make sense?


For what it's worth, I did rewire the code to do everything in one 
thread, with piecemeal writes and it works fine, but is not a good 
solution as far as I am concerned because it is just papering over the 
actual problem.


Sohail


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Any way to debug which query/connection is holding a share lock?

2014-06-13 Thread RSmith


On 2014/06/13 15:02, Sohail Somani wrote:


My application's architecture looks roughly like this:

- A main thread which does only database reads
- A dedicated database write thread

I needed to create this because while reads are fast, there are occasions where writes take a significant portion of time and that 
can cause the main thread to lock up, which results in a sub-par user experience.


Let me pause right here. It doesn't matter which  thread is writing to the DB in which Journal mode, the lock is because you cannot 
change the state of Data in the DB "while other things are reading it". So whether it is the same thread or another thread doesn't 
matter, the moment you start writing to a DB, the readers have to wait.


There are Pragma settings able to change this behaviour, if you use proper journal mode and cache-sharing settings in combination 
with allowing uncomitted reads, BUT before we even point you to that literature, let me ask whether it actually matters? In other 
words, let's say you have a read operation that is scanning through the table, would it matter if some of the records are more 
up-to-date than others?


If this doesn't matter then you might use the said Pragmas to achieve it. If it /DOES/ matter, then you need to rethink the update 
concurrency strategy - such as writing little bits over time in stead of big chunks etc. (This is a recurring theme on here, so lots 
of people here, other than me, are quite knowledgeable on that subject, but a lot more detail about your strategy or problem is needed).


As to the literature on the said Pragmas, kindly see these links:

http://www.sqlite.org/pragma.html#pragma_read_uncommitted
http://www.sqlite.org/isolation.html
http://www.sqlite.org/sharedcache.html

Have a great day!

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Any way to debug which query/connection is holding a share lock?

2014-06-13 Thread Sohail Somani

Hi,

My application's architecture looks roughly like this:

- A main thread which does only database reads
- A dedicated database write thread

I needed to create this because while reads are fast, there are 
occasions where writes take a significant portion of time and that can 
cause the main thread to lock up, which results in a sub-par user 
experience.


The problem I am having is that somewhere in the main thread, something 
is grabbing a shared lock on the SQLite DB and not letting go. the 
effect of this is that the dedicated write thread ends up waiting until 
the application exits(!) in order to do some writes that occur after this.


I've tried debugging manually, disabling various features but I haven't 
been able to pinpoint which bit actually grabs the lock. Are there any 
debugging strategies I can employ to get to the bottom of it?


My current journal_mode is DELETE but WAL has similar problems, in that 
the database writes are not seen, presumably because some reader has an 
open transaction somewhere.


Thanks for your help.

Sohail

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android sqlite error

2014-06-13 Thread Sathish N
Hi Smith,

Yes it is the internal bluetooth application(bluetooth.apk) comes with the
android Os. from yours suggestion i found that the system exceeded the
total number of open fd(file discriptors) due to that its facing this
problem.

As you have mentioned correctly it is Android Os that is blocking the
system to open the database file.

earlier by seeing the error i thought it might be kind of sqlite error
which is out of my knowledge.

With the help of you guys, i am able to figure out the problem.

Thanks,
Sathish N




On Fri, Jun 13, 2014 at 5:21 PM, RSmith  wrote:

>
> On 2014/06/13 09:35, Sathish N wrote:
>
>> hi,
>>
>> Thanks for the help.
>>
>> As i mentioned i am new to sqlite so i am trying my best.
>>
>> And this is not my application .its internal application of android. i am
>> trying to understand and solve this.
>>
>> once again thanks for the help
>>
>
> Hi Sathish,
>
> Apologies, our friend Igor (and me) thought you had made an Android app
> which isn't working. If I understand correct - you did not make this app,
> it is downloaded or somehow native to the device or Android OS you use,
> right?
>
> Also, it is not working because it cannot INSERT or UPDATE the DB since
> that requires writing to the file, and what is clear from your posted logs,
> as Igor tried to point out, is that you do not have access rights to write
> to that destination on that device. In other words, the Android OS is
> blocking your app from writing to the selected destination. You need to
> either change the selected destination folder to write to, or you need to
> change the permissions for the current folder so that it allows you to
> write to it.
>
> Either way, it is a Permission problem and the OS prevents (blocks) you or
> your app to write to that folder because you do not have permission to
> write to it.
>
> How to do all that you will need to find out from the Android guide for
> your device or talk to the people who made the app. We as SQLite community
> members can only tell you WHY SQLite cannot do the INSERTS/UPDATES (because
> the file is not writable) but we do not know how to change your device or
> app or permissions to make that destination writable.
>
>
> (Apologies for the overly verbose piece but the poster likely communicates
> on the other end of a translating device, so more words might paint a
> better picture)
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
Regards
Sathish N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android sqlite error

2014-06-13 Thread RSmith


On 2014/06/13 09:35, Sathish N wrote:

hi,

Thanks for the help.

As i mentioned i am new to sqlite so i am trying my best.

And this is not my application .its internal application of android. i am
trying to understand and solve this.

once again thanks for the help


Hi Sathish,

Apologies, our friend Igor (and me) thought you had made an Android app which isn't working. If I understand correct - you did not 
make this app, it is downloaded or somehow native to the device or Android OS you use, right?


Also, it is not working because it cannot INSERT or UPDATE the DB since that requires writing to the file, and what is clear from 
your posted logs, as Igor tried to point out, is that you do not have access rights to write to that destination on that device. In 
other words, the Android OS is blocking your app from writing to the selected destination. You need to either change the selected 
destination folder to write to, or you need to change the permissions for the current folder so that it allows you to write to it.


Either way, it is a Permission problem and the OS prevents (blocks) you or your app to write to that folder because you do not have 
permission to write to it.


How to do all that you will need to find out from the Android guide for your device or talk to the people who made the app. We as 
SQLite community members can only tell you WHY SQLite cannot do the INSERTS/UPDATES (because the file is not writable) but we do not 
know how to change your device or app or permissions to make that destination writable.



(Apologies for the overly verbose piece but the poster likely communicates on the other end of a translating device, so more words 
might paint a better picture)


___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android sqlite error

2014-06-13 Thread Sathish N
hi,

Thanks for the help.

As i mentioned i am new to sqlite so i am trying my best.

And this is not my application .its internal application of android. i am
trying to understand and solve this.

once again thanks for the help


On Fri, Jun 13, 2014 at 1:00 PM, Igor Korot  wrote:

> Hi,
>
> On Fri, Jun 13, 2014 at 12:24 AM, Sathish N  wrote:
> > hi Igor Korot,
> >
> > yes it is happening, every time i update the database. because of this
> the
> > application is getting crashed.
> >
> > Can you please help me with the solution. As this is the internal apk
> > inside the android.
>
> This is you application and you need to debug it.
> If you don't know what debugging is - learn! If you don't know how to
> learn - ...
>
> Bottom line - only you can help you make it work.
>
> Thank you.
>
> >
> > Thanks.
> >
> >
> >
> > On Fri, Jun 13, 2014 at 12:36 PM, Igor Korot  wrote:
> >
> >> Hi, Satnish,
> >>
> >> On Fri, Jun 13, 2014 at 12:01 AM, Sathish N 
> wrote:
> >> > hi,
> >> >
> >> > Thanks for the reply.
> >> > what do you mean that i cant write at dest. i am not sure what it
> means.
> >>
> >> It means you are trying to execute an INSERT/UPDATE statement which
> fails.
> >> It's quite obvious.
> >>
> >> Thank you.
> >>
> >> >
> >> >
> >> >
> >> >
> >> > On Thu, Jun 12, 2014 at 11:55 PM, mm.w <0xcafef...@gmail.com> wrote:
> >> >
> >> >> you can't write at dest, then the journal file fails, quite obvious
> >> reading
> >> >> the logs
> >> >>
> >> >>
> >> >> On Wed, Jun 11, 2014 at 11:41 PM, Sathish N 
> >> wrote:
> >> >>
> >> >> > I am new for sqlite.
> >> >> >
> >> >> > The following sqlite error comes in my android phone. when i run
> the
> >> >> > application sum times.
> >> >> > I like to know the meaning of this error, why this error come and
> how
> >> to
> >> >> > solve this. I googled about this but nowhere the answer is
> mentioned i
> >> >> > tried all possiblities from what i got when googled about this
> error.
> >> >> >
> >> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >> >> >  E SQLiteLog: (14) os_unix.c:30179: (24)
> >> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >> >> >  E SQLiteLog: (14) os_unix.c:30199: (24)
> >> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >> >> >  E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp
> ORDER
> >> BY
> >> >> > _id] unable to open database file
> >> >> >  E SQLiteQuery: exception: unable to open database file (code 14);
> >> query:
> >> >> > SELECT * FROM btopp ORDER BY _id
> >> >> >
> >> >> >
> >> >> > Kindly please help regarding this issue why this happens
> >> >> > --
> >> >> > Regards
> >> >> > Sathish N
> >> >> > ___
> >> >> > 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
> >> >>
> >> >
> >> >
> >> >
> >> > --
> >> > Regards
> >> > Sathish N
> >> > ___
> >> > 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
> >>
> >
> >
> >
> > --
> > Regards
> > Sathish N
> > ___
> > 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
>



-- 
Regards
Sathish N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android sqlite error

2014-06-13 Thread Igor Korot
Hi,

On Fri, Jun 13, 2014 at 12:24 AM, Sathish N  wrote:
> hi Igor Korot,
>
> yes it is happening, every time i update the database. because of this the
> application is getting crashed.
>
> Can you please help me with the solution. As this is the internal apk
> inside the android.

This is you application and you need to debug it.
If you don't know what debugging is - learn! If you don't know how to
learn - ...

Bottom line - only you can help you make it work.

Thank you.

>
> Thanks.
>
>
>
> On Fri, Jun 13, 2014 at 12:36 PM, Igor Korot  wrote:
>
>> Hi, Satnish,
>>
>> On Fri, Jun 13, 2014 at 12:01 AM, Sathish N  wrote:
>> > hi,
>> >
>> > Thanks for the reply.
>> > what do you mean that i cant write at dest. i am not sure what it means.
>>
>> It means you are trying to execute an INSERT/UPDATE statement which fails.
>> It's quite obvious.
>>
>> Thank you.
>>
>> >
>> >
>> >
>> >
>> > On Thu, Jun 12, 2014 at 11:55 PM, mm.w <0xcafef...@gmail.com> wrote:
>> >
>> >> you can't write at dest, then the journal file fails, quite obvious
>> reading
>> >> the logs
>> >>
>> >>
>> >> On Wed, Jun 11, 2014 at 11:41 PM, Sathish N 
>> wrote:
>> >>
>> >> > I am new for sqlite.
>> >> >
>> >> > The following sqlite error comes in my android phone. when i run the
>> >> > application sum times.
>> >> > I like to know the meaning of this error, why this error come and how
>> to
>> >> > solve this. I googled about this but nowhere the answer is mentioned i
>> >> > tried all possiblities from what i got when googled about this error.
>> >> >
>> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
>> >> >  E SQLiteLog: (14) os_unix.c:30179: (24)
>> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
>> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
>> >> >  E SQLiteLog: (14) os_unix.c:30199: (24)
>> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
>> >> >  E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp ORDER
>> BY
>> >> > _id] unable to open database file
>> >> >  E SQLiteQuery: exception: unable to open database file (code 14);
>> query:
>> >> > SELECT * FROM btopp ORDER BY _id
>> >> >
>> >> >
>> >> > Kindly please help regarding this issue why this happens
>> >> > --
>> >> > Regards
>> >> > Sathish N
>> >> > ___
>> >> > 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
>> >>
>> >
>> >
>> >
>> > --
>> > Regards
>> > Sathish N
>> > ___
>> > 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
>>
>
>
>
> --
> Regards
> Sathish N
> ___
> 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


Re: [sqlite] Android sqlite error

2014-06-13 Thread Sathish N
hi Igor Korot,

yes it is happening, every time i update the database. because of this the
application is getting crashed.

Can you please help me with the solution. As this is the internal apk
inside the android.

Thanks.



On Fri, Jun 13, 2014 at 12:36 PM, Igor Korot  wrote:

> Hi, Satnish,
>
> On Fri, Jun 13, 2014 at 12:01 AM, Sathish N  wrote:
> > hi,
> >
> > Thanks for the reply.
> > what do you mean that i cant write at dest. i am not sure what it means.
>
> It means you are trying to execute an INSERT/UPDATE statement which fails.
> It's quite obvious.
>
> Thank you.
>
> >
> >
> >
> >
> > On Thu, Jun 12, 2014 at 11:55 PM, mm.w <0xcafef...@gmail.com> wrote:
> >
> >> you can't write at dest, then the journal file fails, quite obvious
> reading
> >> the logs
> >>
> >>
> >> On Wed, Jun 11, 2014 at 11:41 PM, Sathish N 
> wrote:
> >>
> >> > I am new for sqlite.
> >> >
> >> > The following sqlite error comes in my android phone. when i run the
> >> > application sum times.
> >> > I like to know the meaning of this error, why this error come and how
> to
> >> > solve this. I googled about this but nowhere the answer is mentioned i
> >> > tried all possiblities from what i got when googled about this error.
> >> >
> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >> >  E SQLiteLog: (14) os_unix.c:30179: (24)
> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >> >  E SQLiteLog: (14) os_unix.c:30199: (24)
> >> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >> >  E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp ORDER
> BY
> >> > _id] unable to open database file
> >> >  E SQLiteQuery: exception: unable to open database file (code 14);
> query:
> >> > SELECT * FROM btopp ORDER BY _id
> >> >
> >> >
> >> > Kindly please help regarding this issue why this happens
> >> > --
> >> > Regards
> >> > Sathish N
> >> > ___
> >> > 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
> >>
> >
> >
> >
> > --
> > Regards
> > Sathish N
> > ___
> > 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
>



-- 
Regards
Sathish N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Android sqlite error

2014-06-13 Thread Igor Korot
Hi, Satnish,

On Fri, Jun 13, 2014 at 12:01 AM, Sathish N  wrote:
> hi,
>
> Thanks for the reply.
> what do you mean that i cant write at dest. i am not sure what it means.

It means you are trying to execute an INSERT/UPDATE statement which fails.
It's quite obvious.

Thank you.

>
>
>
>
> On Thu, Jun 12, 2014 at 11:55 PM, mm.w <0xcafef...@gmail.com> wrote:
>
>> you can't write at dest, then the journal file fails, quite obvious reading
>> the logs
>>
>>
>> On Wed, Jun 11, 2014 at 11:41 PM, Sathish N  wrote:
>>
>> > I am new for sqlite.
>> >
>> > The following sqlite error comes in my android phone. when i run the
>> > application sum times.
>> > I like to know the meaning of this error, why this error come and how to
>> > solve this. I googled about this but nowhere the answer is mentioned i
>> > tried all possiblities from what i got when googled about this error.
>> >
>> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
>> >  E SQLiteLog: (14) os_unix.c:30179: (24)
>> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
>> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
>> >  E SQLiteLog: (14) os_unix.c:30199: (24)
>> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
>> >  E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp ORDER BY
>> > _id] unable to open database file
>> >  E SQLiteQuery: exception: unable to open database file (code 14); query:
>> > SELECT * FROM btopp ORDER BY _id
>> >
>> >
>> > Kindly please help regarding this issue why this happens
>> > --
>> > Regards
>> > Sathish N
>> > ___
>> > 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
>>
>
>
>
> --
> Regards
> Sathish N
> ___
> 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


Re: [sqlite] Android sqlite error

2014-06-13 Thread Sathish N
hi,

Thanks for the reply.
what do you mean that i cant write at dest. i am not sure what it means.




On Thu, Jun 12, 2014 at 11:55 PM, mm.w <0xcafef...@gmail.com> wrote:

> you can't write at dest, then the journal file fails, quite obvious reading
> the logs
>
>
> On Wed, Jun 11, 2014 at 11:41 PM, Sathish N  wrote:
>
> > I am new for sqlite.
> >
> > The following sqlite error comes in my android phone. when i run the
> > application sum times.
> > I like to know the meaning of this error, why this error come and how to
> > solve this. I googled about this but nowhere the answer is mentioned i
> > tried all possiblities from what i got when googled about this error.
> >
> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >  E SQLiteLog: (14) os_unix.c:30179: (24)
> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >  E SQLiteLog: (14) cannot open file at line 30179 of [00cd9d8ce4]
> >  E SQLiteLog: (14) os_unix.c:30199: (24)
> > open(/data/data/com.android.bluetooth/databases/btopp.db-journal) -
> >  E SQLiteLog: (14) statement aborts at 23: [SELECT * FROM btopp ORDER BY
> > _id] unable to open database file
> >  E SQLiteQuery: exception: unable to open database file (code 14); query:
> > SELECT * FROM btopp ORDER BY _id
> >
> >
> > Kindly please help regarding this issue why this happens
> > --
> > Regards
> > Sathish N
> > ___
> > 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
>



-- 
Regards
Sathish N
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users