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.
Reviewed: https:/ /review. openstack. org/59566 github. com/openstack/ marconi/ commit/ ce5a814cb1731b8 17cbb74aa892dfd 94304e1b28
Committed: http://
Submitter: Jenkins
Branch: master
commit ce5a814cb1731b8 17cbb74aa892dfd 94304e1b28
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: I2ce46c20158fbf 090a25736b3afc1 dd32437af24