Fix locking issues with the RBTools API cache database.

Review Request #6716 — Created Dec. 31, 2014 and submitted

Information

RBTools
master
58c5e1f...

Reviewers

When an RBTools command executed another command via a Popen call, the
subcommand would fail with a locking error on the API cache database.

This turned out to be the result of RBTools only ever calling commit()
when exiting the process. As per the sqlite documentation, any write
operation will lock the database, blocking all reads, until the process
calls commit(), but we weren't doing that after writes.

We now call commit() after we close the cursor for any write operation.

Successfully ran 'rbt land' with a remote change, resulting in it
calling out to 'rbt patch'. It didn't lock the database.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        rbtools/api/cache.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        rbtools/api/cache.py
    
    
  2. 
      
brennie
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (6c3e87e)