Comment 2 for bug 1257093

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to marconi (master)

Reviewed: https://review.openstack.org/59566
Committed: http://github.com/openstack/marconi/commit/ce5a814cb1731b817cbb74aa892dfd94304e1b28
Submitter: Jenkins
Branch: master

commit ce5a814cb1731b817cbb74aa892dfd94304e1b28
Author: Flavio Percoco <email address hidden>
Date: Mon Dec 2 23:19:11 2013 +0100

    Make sqlite connection lazy

    The patch makes sqlite database connection lazy.

    If the sqlite connection is created in a thread and then accessed from
    another one, it'll fail mentioning that the connection is not thread
    safe and that sqlite objects should be accessed from within the thread
    the connection was created in.

    Creating the connection instance at the very end alleviates this issue
    but it doesn't fix it completely. It is still possible to create a
    connection in a sub thread and then access it from another one. This
    patch just makes that less probable by creating the instance when it's
    actually needed.

    Closes-bug: 1257093

    Change-Id: I2ce46c20158fbf090a25736b3afc1dd32437af24