[EMAIL PROTECTED] wrote: 
> 
> Process A wants to modify the database, so it flock()s 
> the rows it needs to changes and starts changing them. 
> But half way in the middle of the change, somebody sends 
> process A a SIGKILL and it dies.  The OS automatically 
> releases the flocks as process A dies, leaving the 
> database half-way updated and in an inconsistent state, 
> with no locks. 

When Process A is being killed and OS automatically 
releases the flocks, will rollback journal be present or not ? 

I think, in this situation, hot journal will be left when 
Process A is killed.

> Process B comes along and opens the database, see the 
> inconsistent state, and reports database corruption. 
> 

If Process B finds a rollback journal...then...it can use 
that to rollback database and bring it to consistent state.

-------


Curiously thinking on this...

What if a new SYSTEM-LOCK-MGMT-TABLE is added in SQLite database 
managed by itself for locking management ? (Surely, it is not an easy 
task to manage SYSTEM-LOCK-MGMT-TABLE..!!! )

Assuming that, if there is one an added SYSTEM-LOCK-TABLE in 
SQLite database managed by itself for locking management.

Then when Process A wants to modify the database and it flock()s 
the rows it needs to changes, it should add corresponding 
info as record in SYSTEM-LOCK-TABLE for that...

When somebody sends process A a SIGKILL and it dies, OS 
will automatically release flocks as process A dies. Process
B (any other process accessing database) can find necessary
locking related info from SYSTEM-LOCK-TABLE, as well as hot journal 
and so Process B can bring database back to consistent state.

Rohit

-- 
View this message in context: 
http://www.nabble.com/SQLite-Vs-VistaDB---Comparison-----tf1797052.html#a5255158
Sent from the SQLite forum at Nabble.com.

Reply via email to