mirror of
https://github.com/openkmip/pykmip
synced 2025-12-15 07:43:26 +00:00
Fixing a bug with multithreading support with the SQLite backend
This change fixes a bug that could occur when accessing the server with multiple threads or processes. The SQLite backend by default does not support multithreading. This change updates how the SQLite backend is instantiated, preventing error generation when using multiple clients simultaenously. The server unit test suite has been updated to cover the change.
This commit is contained in:
@@ -98,7 +98,8 @@ class KmipEngine(object):
|
||||
|
||||
self._data_store = sqlalchemy.create_engine(
|
||||
'sqlite:////tmp/pykmip.database',
|
||||
echo=False
|
||||
echo=False,
|
||||
connect_args={'check_same_thread': False}
|
||||
)
|
||||
sqltypes.Base.metadata.create_all(self._data_store)
|
||||
self._data_store_session_factory = sqlalchemy.orm.sessionmaker(
|
||||
|
||||
Reference in New Issue
Block a user