Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-18 Thread Bharath Booshan L

> Do you test for SQLITE_BUSY, when you perform BEGIN IMMEDIATE ?
> 

Yes, I do.

> Yes a process that is reading will continue to read. Once it completes if
> anothre process is waiting to write then the additional read locks will not be
> granted. This is to prevent writer starvation.
> 
> How do you know that the data for which you are querying is actually loaded? I
> don't think you can since you invoke a load process after the query.
> 

I query for updated data only after the  writer process is terminated.



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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


Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-18 Thread Bharath Booshan L

> Where do the  and  come from?
> Where do the  and  come from?
> Where does all the data to create the new records come from? You say
> Process A only has a FilePath as input.



> Where do the  and  come from?
> 

All the Information written into the database is extracted from the file
itself. The Segments data is also available within the file itself. We
manually append these information when we save the file.

> What do you mean by the line that says "Info Values)"?
> 
It is just the information retrieved from file.



> 
> It seems strange to change the creation date for an update. I would
> think this should only happen when the record is created in step d.

Yes. Can't imagine how did I do this silly thing.





> Where is this "set of files" coming from? The query in step a returns
> results for a single file only. Process A takes a FilePath parameter,
> the same as used in the where clause in query above I would assume.




>> "SELECT * FROM Segments,File WHERE File.FileID =  Segments.FileID AND
>> File.FullPath = ;
>> 
> 
> This will return the primary key for each segment associated with the
> file. With that you can get any other info about the segment that may be
> needed.
Yes, that is what I need. I require all the information matching the given
file.




>> 
>> C) Repeat Step a)
>> 
> 
> This is where you say you are having problems, correct? Are you saying
> that you are not getting the same segments for the file FileA after
> running process A with a parameter value of FileA?
> 
> This is unexpected since you say Process A only updates existing rows if
> the file FileA exists. It only adds new rows if FileA doesn't exist. But
> if FileA doesn't exist when you run Process A then there would have been
> nothing to return from the query in step a above, so any new rows would
> be expected. If the file exists, then you update some column values, but
> not the values that are used to select the results in the query in step
> a above, so the results should be the same.
> 
> Is there more stuff happening elsewhere that you haven't described? Are
> the file and/or segment rows ever deleted?
> 
Yes, the segments rows which are not updated are also deleted. This happens
only when I do some large inserts/updates continuously i.e add/update file
info and request for the updated as well as old data. I think there is some
concurrency issues at my side. Now I have to re-visit to in what order are
these inserts & selects are performed actually.

> Process A knows it will write later, so the reserved lock at step a lets
> others continue to read until it gets to step c or step d. The advantage
> of this is that it prevents some other process form executing a delete
> between your steps a and c for example. If the file existed when your
> process A did its existence check as step a, but didn't exist when it
> got to step c, there would be problems (not the problems you are seeing
> though). It is probably a good idea to acquire the lock (i.e. start the
> immediate transaction) before you start reading the database though.

Just I tried to have an EXCLUSIVE lock in Process A just to ensure that
writer process doesn't have to wait for reader process, and from that time
onwards I am not getting this issue, atleast till now. But I cannot sign it
off, treating this as the required change. Will look exactly what is
happening.

Since I am seeing this problem after upgrading it to 3.4.0, I thought its
better to ask the list whether there were any known issues regarding
database corrupt.


Thanks for all your inputs,

Will feedback what exactly is the case after I fix it, so that another
person will get to know if he encounter with similar issue.




--

Bharath

On 3/18/08 12:59 AM, "Dennis Cote" <[EMAIL PROTECTED]> wrote:






---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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


Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Dennis Cote
Bharath Booshan L wrote:
> 
> Table File:
> -
> FileID  INTEGER PRIMARY KEY Auto Incrment
> FullPathTEXT
> FileNameTEXT
> CreationDateREAL
> ModifiedDateREAL
> 
> 
> Table Segments:
> ---
> FileID  INTEGER REFERENCES File(FileID)
> SegmentID   TEXT PRIMARY KEY
> SegmentName TEXT
> Description TEXT
> 
> Table Metadata:
> --
> FileID  INTEGER REFERENCES File(FileID)
> NameTEXT
> MetaDataID  INTEGER PRIMARY KEY
> 
> Table SegmentMetadata
> ---
> SegmetnID   TEXT REFERENCES Segments(SegmentID)
> MetadaIDINTEGER REFERENCES Metada(MetaDataID)
> 
> 
> Process A: (accepts FilePath as input)
> --
> a) Check If File exists in table - "SELECT * from File WHERE FullPath =
>
> b) BEGIN IMMEDIATE TRANSACTION
> c) if exists: UPDATE table File  SET  CreationDate =,
> ModificationDate = 
> Info Values)

It seems strange to change the creation date for an update. I would 
think this should only happen when the record is created in step d.

What do you mean by the line that says "Info Values)"?

Where do the  and  come from?

> UPDATE table Segments SET  SegmentName = , Desription =
>  WHERE FileID = 
> 

Where do the  and  come from?

> d) If FilePath doesn't exists then create a new entry  File Table, Segments
> Segments table, Metadata table and in SegmentMetada, in order
> 

Where does all the data to create the new records come from? You say 
Process A only has a FilePath as input.

> E) COMMIT
> ---
> 
> Process B:
> -
> a) Query used to Read Sements in File, say File A:
> 

So, a File has one or more segments.

> "SELECT * FROM Segments,File WHERE File.FileID =  Segments.FileID AND
> File.FullPath = ;
> 

This will return the primary key for each segment associated with the 
file. With that you can get any other info about the segment that may be 
needed.

select SegmentID
from File join Segments using(FileID)
where FullPath = ;

> b)Invoke Process A for each set of files

Where is this "set of files" coming from? The query in step a returns 
results for a single file only. Process A takes a FilePath parameter, 
the same as used in the where clause in query above I would assume.

> 
> C) Repeat Step a)
> 

This is where you say you are having problems, correct? Are you saying 
that you are not getting the same segments for the file FileA after 
running process A with a parameter value of FileA?

This is unexpected since you say Process A only updates existing rows if 
the file FileA exists. It only adds new rows if FileA doesn't exist. But 
if FileA doesn't exist when you run Process A then there would have been 
nothing to return from the query in step a above, so any new rows would 
be expected. If the file exists, then you update some column values, but 
not the values that are used to select the results in the query in step 
a above, so the results should be the same.

Is there more stuff happening elsewhere that you haven't described? Are 
the file and/or segment rows ever deleted?

> 
> Is that BEGIN IMMEDIATE TRANSACTION causing problem? It says, it acquires
> RESERVED lock, but it allows other process to read.

I don't think that is your problem. The reserved lock simply lets other 
processes read until the holder is ready to start making changes. The 
reserved lock will change to an exclusive lock when process A starts its 
  first update command. It is intended to let a process read with the 
assurance that no other process can write to the database.

It would typically be used to move your step a in process A to a point 
between step b and step c like this.

a) BEGIN IMMEDIATE TRANSACTION
b) Check If File exists in table - "SELECT * from File WHERE FullPath = 

c) if exists: UPDATE table File  SET  CreationDate =,

Process A knows it will write later, so the reserved lock at step a lets 
others continue to read until it gets to step c or step d. The advantage 
of this is that it prevents some other process form executing a delete 
between your steps a and c for example. If the file existed when your 
process A did its existence check as step a, but didn't exist when it 
got to step c, there would be problems (not the problems you are seeing 
though). It is probably a good idea to acquire the lock (i.e. start the 
immediate transaction) before you start reading the database though.

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


Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Ken
Do you test for SQLITE_BUSY, when you perform BEGIN IMMEDIATE ?   

Yes a process that is reading will continue to read. Once it completes if 
anothre process is waiting to write then the additional read locks will not be 
granted. This is to prevent writer starvation.

How do you know that the data for which you are querying is actually loaded? I 
don't think you can since you invoke a load process after the query.

HTH.

Bharath Booshan L <[EMAIL PROTECTED]> wrote: > You will have to provide more 
detail about what you are doing to change
> the database. Since you say process A is the only one that write to the
> database, you would probably be best to post the actual code, or at
> least the actual SQL statements, that you are using in that process

Ok. Here it is.


Table File:
-
FileID  INTEGER PRIMARY KEY Auto Incrment
FullPathTEXT
FileNameTEXT
CreationDateREAL
ModifiedDateREAL


Table Segments:
---
FileID  INTEGER REFERENCES File(FileID)
SegmentID   TEXT PRIMARY KEY
SegmentName TEXT
Description TEXT

Table Metadata:
--
FileID  INTEGER REFERENCES File(FileID)
NameTEXT
MetaDataID  INTEGER PRIMARY KEY

Table SegmentMetadata
---
SegmetnID   TEXT REFERENCES Segments(SegmentID)
MetadaIDINTEGER REFERENCES Metada(MetaDataID)


Process A: (accepts FilePath as input)
--
a) Check If File exists in table - "SELECT * from File WHERE FullPath =
   
b) BEGIN IMMEDIATE TRANSACTION
c) if exists: UPDATE table File  SET  CreationDate =,
ModificationDate = 
Info Values)
UPDATE table Segments SET  SegmentName = , Desription =
 WHERE FileID = 

d) If FilePath doesn't exists then create a new entry  File Table, Segments
Segments table, Metadata table and in SegmentMetada, in order

E) COMMIT
---

Process B:
-
a) Query used to Read Sements in File, say File A:

"SELECT * FROM Segments,File WHERE File.FileID =  Segments.FileID AND
File.FullPath = ;

b)Invoke Process A for each set of files

C) Repeat Step a)


Hope I am clear.

Is that BEGIN IMMEDIATE TRANSACTION causing problem? It says, it acquires
RESERVED lock, but it allows other process to read.

--
Bharath

On 3/17/08 8:34 PM, "Dennis Cote"  wrote:

> Bharath Booshan L wrote:
>> 
>> I will give overview of what is happening
>> 
>> App A - Writer process
>> ---
>> * Open SQLIte Connection
>> * BEGIN IMMEDIATE TRASACTION
>> * Insert/Update some 1000 rows in Table A,B,C
>> * COMMIT 
>> * Close SQLite connection
>> ---
>> 
>> 
>> App B - Reader process
>> 
>> A) Open SQLite Connection
>> 
>> B) Read rows fro Table A,B,C based on some constraint -( Returned Results
>> are
>>   as expected)
>> ...
>> 
>> C) Initiate App A to write some 10-20 times information (This step is
>> executed several times, however it is ensured that all these write
>> operations are serialized)
>> 
>> D) Read rows fro Table A,B,C based on some constraint -( Returned Results
>> are not as expected. )
>> 
>> E) Close SQLite connection
>> -
>> 
>> The actual problem I am facing is at the last step in App B, where I expect
>> that all the information updated/inserted to be returned from query, instead
>> some of the rows in table A,B,C are lost forever.
> 
> Based on what you have said here there should be no problems.
> 
> You will have to provide more detail about what you are doing to change
> the database. Since you say process A is the only one that write to the
> database, you would probably be best to post the actual code, or at
> least the actual SQL statements, that you are using in that process.
> 
>> (just to know what is left in database, I tried to open the database in some
>> document application, for example TextEdit, and the row information which
>> looked as erased are available, and in between all these the database size
>> has not changed )
>> 
> 
> That is a very unreliable way to look an SQLite database. SQLite doesn't
> necessarily remove data that has been deleted, it may remain in unused
> pages and/or records in the database file. SQLite doesn't change the
> size of the file when rows are deleted or updated, any pages that are no
> longer used are added to an internal free page list.
> 
> You should use the command line sqlite3 program to view the database file.
> 
>> Overall I guess I am using some wrong version which I need to upgrade to new
>> version, but have to re-consider if it requires major change.
> 
> There should be no need to use a different version.
> 
> 
> 

Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread John Stanton
How are you synchronizing your updates and reads?  It looks like you may 
be missing a COMMIT.

Bharath Booshan L wrote:
> Ken,
>  
> Thanks for reply,
> 
> 
>>I would start with APP A to determine after processing that the data that you
>>asked to be loaded is actually loaded. If it does not, then look into app A.
>>
> 
> I think I need to add some more information here.
> 
> App B will be in running state, and whenever a write operation needs to be
> performed, it invokes App B.
> 
> 
> 
>>If app A data load succeeds (and is correct in that all data loaded).
>>Run app B. If this errors out you more than likely have a query related
>>problem.
> 
> 
> Query is absolutely fine. A simple select on the table after the database
> table corrupt does not show some rows, which is expected to be there.
> 
> I will post the simple schema and the actual SQL statements I am using so
> that might be helpful.
> --
> 
> Bharath
> 
> 
> On 3/17/08 8:16 PM, "Ken" <[EMAIL PROTECTED]> wrote:
> 
> 
> 
> 
>>HTH,
>>Ken
> 
> 
> 
> 
> ---
> Robosoft Technologies - Come home to Technology
> 
> Disclaimer: This email may contain confidential material. If you were not an 
> intended recipient, please notify the sender and delete all copies. Emails to 
> and from our network may be logged and monitored. This email and its 
> attachments are scanned for virus by our scanners and are believed to be 
> safe. However, no warranty is given that this email is free of malicious 
> content or virus.
> 
> 
> ___
> 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] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Bharath Booshan L
Ken,
 
Thanks for reply,

> I would start with APP A to determine after processing that the data that you
> asked to be loaded is actually loaded. If it does not, then look into app A.
> 
I think I need to add some more information here.

App B will be in running state, and whenever a write operation needs to be
performed, it invokes App B.


> If app A data load succeeds (and is correct in that all data loaded).
> Run app B. If this errors out you more than likely have a query related
> problem.

Query is absolutely fine. A simple select on the table after the database
table corrupt does not show some rows, which is expected to be there.

I will post the simple schema and the actual SQL statements I am using so
that might be helpful.
--

Bharath


On 3/17/08 8:16 PM, "Ken" <[EMAIL PROTECTED]> wrote:



> 
> HTH,
> Ken



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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


Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Dennis Cote
Bharath Booshan L wrote:
> 
> I will give overview of what is happening
> 
> App A - Writer process
> ---
> * Open SQLIte Connection
> * BEGIN IMMEDIATE TRASACTION
> * Insert/Update some 1000 rows in Table A,B,C
> * COMMIT 
> * Close SQLite connection
> ---
> 
> 
> App B - Reader process
> 
> A) Open SQLite Connection
> 
> B) Read rows fro Table A,B,C based on some constraint -( Returned Results
> are
>   as expected)
> ...
> 
> C) Initiate App A to write some 10-20 times information (This step is
> executed several times, however it is ensured that all these write
> operations are serialized)
> 
> D) Read rows fro Table A,B,C based on some constraint -( Returned Results
> are not as expected. )
> 
> E) Close SQLite connection
> -
> 
> The actual problem I am facing is at the last step in App B, where I expect
> that all the information updated/inserted to be returned from query, instead
> some of the rows in table A,B,C are lost forever.

Based on what you have said here there should be no problems.

You will have to provide more detail about what you are doing to change 
the database. Since you say process A is the only one that write to the 
database, you would probably be best to post the actual code, or at 
least the actual SQL statements, that you are using in that process.

> (just to know what is left in database, I tried to open the database in some
> document application, for example TextEdit, and the row information which
> looked as erased are available, and in between all these the database size
> has not changed )
> 

That is a very unreliable way to look an SQLite database. SQLite doesn't 
necessarily remove data that has been deleted, it may remain in unused 
pages and/or records in the database file. SQLite doesn't change the 
size of the file when rows are deleted or updated, any pages that are no 
longer used are added to an internal free page list.

You should use the command line sqlite3 program to view the database file.

> Overall I guess I am using some wrong version which I need to upgrade to new
> version, but have to re-consider if it requires major change.

There should be no need to use a different version.


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


Re: [sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Ken
I would start with APP A to determine after processing that the data that you 
asked to be loaded is actually loaded. If it does not, then look into app A.

If app A data load succeeds (and is correct in that all data loaded).
Run app B. If this errors out you more than likely have a query related problem.

HTH,
Ken


Bharath Booshan L <[EMAIL PROTECTED]> wrote: 

Hello List,

 Here I am stuck with some Database Table corrupt problem and I would
request the people on this list to help me out as I am unable to figure out
the cause for this problem.

Previously I was using SQLite 3.1.3 and now since our application should
support Mac OS Leapord, it uses SQLite 3.4.0 which is available in the OS by
default.

I will give overview of what is happening

App A - Writer process
---
* Open SQLIte Connection
* BEGIN IMMEDIATE TRASACTION
* Insert/Update some 1000 rows in Table A,B,C
* COMMIT 
* Close SQLite connection
---


App B - Reader process

A) Open SQLite Connection

B) Read rows fro Table A,B,C based on some constraint -( Returned Results
are
  as expected)
...

C) Initiate App A to write some 10-20 times information (This step is
executed several times, however it is ensured that all these write
operations are serialized)

D) Read rows fro Table A,B,C based on some constraint -( Returned Results
are not as expected. )

E) Close SQLite connection
-

The actual problem I am facing is at the step D, in App B, where I expect
that all the information updated/inserted to be returned from query, instead
some of the rows in table A,B,C are lost forever.

(just to know what is left in database, I tried to open the database in some
document application, for example TextEdit, and the row information which
looked as erased are available, and in between all these the database size
has not changed )



I have checked these following links and one thing I required to change is
"BEGIN IMMEDIATE TRANSACTION" to "BEGIN EXCLUSIVE TRANSACTION", but did not
see any impact from this.

http://www.sqlite.org/releaselog/3_4_0.html
http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError

Overall I guess I am using some wrong version which I need to upgrade to new
version, but have to re-consider if it requires major change.

I am bit unclear in my explanation I suppose, please let me know I could
provide some more information.


Any inputs will be very helpful,


Thanks & Regards,

Bharath

PS: The information written into the database is just a text information,
precisely, it stores File attribute and some metadata.



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


___
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] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Bharath Booshan L


Hello List,

 Here I am stuck with some Database Table corrupt problem and I would
request the people on this list to help me out as I am unable to figure out
the cause for this problem.

Previously I was using SQLite 3.1.3 and now since our application should
support Mac OS Leapord, it uses SQLite 3.4.0 which is available in the OS by
default.

I will give overview of what is happening

App A - Writer process
---
* Open SQLIte Connection
* BEGIN IMMEDIATE TRASACTION
* Insert/Update some 1000 rows in Table A,B,C
* COMMIT 
* Close SQLite connection
---


App B - Reader process

A) Open SQLite Connection

B) Read rows fro Table A,B,C based on some constraint -( Returned Results
are
  as expected)
...

C) Initiate App A to write some 10-20 times information (This step is
executed several times, however it is ensured that all these write
operations are serialized)

D) Read rows fro Table A,B,C based on some constraint -( Returned Results
are not as expected. )

E) Close SQLite connection
-

The actual problem I am facing is at the step D, in App B, where I expect
that all the information updated/inserted to be returned from query, instead
some of the rows in table A,B,C are lost forever.

(just to know what is left in database, I tried to open the database in some
document application, for example TextEdit, and the row information which
looked as erased are available, and in between all these the database size
has not changed )



I have checked these following links and one thing I required to change is
"BEGIN IMMEDIATE TRANSACTION" to "BEGIN EXCLUSIVE TRANSACTION", but did not
see any impact from this.

http://www.sqlite.org/releaselog/3_4_0.html
http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError

Overall I guess I am using some wrong version which I need to upgrade to new
version, but have to re-consider if it requires major change.

I am bit unclear in my explanation I suppose, please let me know I could
provide some more information.


Any inputs will be very helpful,


Thanks & Regards,

Bharath

PS: The information written into the database is just a text information,
precisely, it stores File attribute and some metadata.



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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


[sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Bharath Booshan L

Hello List,

 Here I am stuck with some Database Table corrupt problem and I would
request the people on this list to help me out as I am unable to figure out
the cause for this problem.

Previously I was using SQLite 3.1.3 and now since our application should
support Mac OS Leapord, it uses SQLite 3.4.0 which is available in the OS by
default.

I will give overview of what is happening

App A - Writer process
---
* Open SQLIte Connection
* BEGIN IMMEDIATE TRASACTION
* Insert/Update some 1000 rows in Table A,B,C
* COMMIT 
* Close SQLite connection
---


App B - Reader process

A) Open SQLite Connection

B) Read rows fro Table A,B,C based on some constraint -( Returned Results
are
  as expected)
...

C) Initiate App A to write some 10-20 times information (This step is
executed several times, however it is ensured that all these write
operations are serialized)

D) Read rows fro Table A,B,C based on some constraint -( Returned Results
are not as expected. )

E) Close SQLite connection
-

The actual problem I am facing is at the step D, in App B, where I expect
that all the information updated/inserted to be returned from query, instead
some of the rows in table A,B,C are lost forever.

(just to know what is left in database, I tried to open the database in some
document application, for example TextEdit, and the row information which
looked as erased are available, and in between all these the database size
has not changed )



I have checked these following links and one thing I required to change is
"BEGIN IMMEDIATE TRANSACTION" to "BEGIN EXCLUSIVE TRANSACTION", but did not
see any impact from this.

http://www.sqlite.org/releaselog/3_4_0.html
http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError

Overall I guess I am using some wrong version which I need to upgrade to new
version, but have to re-consider if it requires major change.

I am bit unclear in my explanation I suppose, please let me know I could
provide some more information.


Any inputs will be very helpful,


Thanks & Regards,

Bharath

PS: The information written into the database is just a text information,
precisely, it stores File attribute and some metadata.



---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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


[sqlite] Database Table corrupt in SQLite v 3.4.0

2008-03-17 Thread Bharath Booshan L
Hello List,

 Here I am stuck with some Database Table corrupt problem and I would
request the people on this list to help me out as I am unable to figure out
the cause for this problem.

Previously I was using SQLite 3.1.3 and now since our application should
support Mac OS Leapord, it uses SQLite 3.4.0 which is available in the OS by
default.

I will give overview of what is happening

App A - Writer process
---
* Open SQLIte Connection
* BEGIN IMMEDIATE TRASACTION
* Insert/Update some 1000 rows in Table A,B,C
* COMMIT 
* Close SQLite connection
---


App B - Reader process

A) Open SQLite Connection

B) Read rows fro Table A,B,C based on some constraint -( Returned Results
are
  as expected)
...

C) Initiate App A to write some 10-20 times information (This step is
executed several times, however it is ensured that all these write
operations are serialized)

D) Read rows fro Table A,B,C based on some constraint -( Returned Results
are not as expected. )

E) Close SQLite connection
-

The actual problem I am facing is at the last step in App B, where I expect
that all the information updated/inserted to be returned from query, instead
some of the rows in table A,B,C are lost forever.

(just to know what is left in database, I tried to open the database in some
document application, for example TextEdit, and the row information which
looked as erased are available, and in between all these the database size
has not changed )



I have checked these following links and one thing I required to change is
"BEGIN IMMEDIATE TRANSACTION" to "BEGIN EXCLUSIVE TRANSACTION", but did not
see any impact from this.

http://www.sqlite.org/releaselog/3_4_0.html
http://www.sqlite.org/cvstrac/wiki?p=CorruptionFollowingBusyError

Overall I guess I am using some wrong version which I need to upgrade to new
version, but have to re-consider if it requires major change.

I am bit unclear in my explanation I suppose, please let me know I could
provide some more information.


Any inputs will be very helpful,


Thanks & Regards,

Bharath

PS: The information written into the database is just a text information,
precisely, it stores File attribute and some metadata.





---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.


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