# WAL and LOCK files



## Steve (Apr 22, 2019)

I understand these are both temporary files open when LR is running.  My Lightroom classic shut down when running, and I have an LRCAT file as well as the Lock and wal files, and am unable to open the LRCAT file.  I understand I need to delete the LOCK file to re-open the Lightroom catalogue,  My question is whether I also need to delete the wal file.  Thank you.  Steve


----------



## Rob_Cullen (Apr 22, 2019)

Just delete the  .LOCK file only and it will allow a restart.

See other forum posts on the same question- https://forums.adobe.com/thread/2409147


----------



## Johan Elzenga (Apr 22, 2019)

AFAIK, you can also delete the WAL file if Lightroom didn’t do that because of a crash. You can also leave it for now and restart Lightroom. If it’s still there when you next quit Lightroom, then it is clearly no longer used and can be deleted.


----------



## Jim Wilde (Apr 22, 2019)

I have a feeling that Adobe's advice would be to leave the WAL file alone in this situation, i.e. do not delete it. The WAL file (Write Ahead Log) replaced the Journal file which was used in previous Lightroom versions, and definitely the advice for the Journal file was "do not delete". In theory, the WAL file could contain details of database transactions scheduled but not yet completed at the time of the crash, thus if the WAL file is still present when LR next starts it should be interrogated for those outstanding transactions. 

But that's just my limited understanding, so I might not have got it quite right. It certainly wouldn't hurt to leave the file alone though.


----------



## Johan Elzenga (Apr 22, 2019)

Yes, it's probably best to leave it for the first restart. If Lightroom then still does not clean it up, then it apparently doesn't use it anymore.


----------



## clee01l (Apr 22, 2019)

LR  has moved to the "write-ahead logging" (WAL) provided by newer versions of SQLite. This is supposed to make updates to the database faster.  However if the Update Statement was to update 100 records and only 40 were updated before the crash the WAL file could become important to prevent a corrupted catalog down the road.   As others have suggested . let LR clean it up on restart and only remove the WAL file manually after you have restarted successfully should it remain after the LR next successful shutdown.


----------

