Skip to content

Commit 9047fee

Browse files
committedApr 27, 2020
Set connect_args={"check_same_thread": False} to avoid "not the owner thread" warnings from sqlite.
1 parent b61630c commit 9047fee

File tree

33 files changed

+190
-31
lines changed

33 files changed

+190
-31
lines changed
 

‎app/ch09_sqlalchemy/final/.idea/.name

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch09_sqlalchemy/final/.idea/flask ch09_sqlalchemy - final.iml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch09_sqlalchemy/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def global_init(db_file: str):
1818
conn_str = 'sqlite:///' + db_file.strip()
1919
print("Connecting to DB with {}".format(conn_str))
2020

21-
engine = sa.create_engine(conn_str, echo=False)
21+
# Adding check_same_thread = False after the recording. This can be an issue about
22+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
23+
# that we probably don't care about in this example.
24+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2225
factory = orm.sessionmaker(bind=engine)
2326

2427
# noinspection PyUnresolvedReferences

‎app/ch10_using_sqlachemy/final/.idea/.name

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch10_using_sqlachemy/final/.idea/inspectionProfiles/Project_Default.xml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch10_using_sqlachemy/final/.idea/modules.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch10_using_sqlachemy/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch10_using_sqlachemy/starter/.idea/flask ch10_using_sqlachemy - starter.iml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch10_using_sqlachemy/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def global_init(db_file: str):
1818
conn_str = 'sqlite:///' + db_file.strip()
1919
print("Connecting to DB with {}".format(conn_str))
2020

21-
engine = sa.create_engine(conn_str, echo=False)
21+
# Adding check_same_thread = False after the recording. This can be an issue about
22+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
23+
# that we probably don't care about in this example.
24+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2225
factory = orm.sessionmaker(bind=engine)
2326

2427
# noinspection PyUnresolvedReferences

‎app/ch11_migrations/final/.idea/.name

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch11_migrations/final/.idea/inspectionProfiles/Project_Default.xml

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch11_migrations/final/.idea/modules.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch11_migrations/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch11_migrations/starter/.idea/flask ch11_migrations - starter.iml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch11_migrations/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch12-forms/final/.idea/.name

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch12-forms/final/.idea/dataSources.local.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch12-forms/final/.idea/flask-html-forms.iml renamed to ‎app/ch12-forms/final/.idea/flask ch12-forms - final.iml

+1-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch12-forms/final/.idea/modules.xml

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch12-forms/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch12-forms/starter/.idea/flask ch12-forms - starter.iml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch12-forms/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch13-validation/final/.idea/dataSources.local.xml

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch13-validation/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch13-validation/starter/.idea/dataSources.local.xml

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch13-validation/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch14_testing/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch14_testing/starter/.idea/dataSources.local.xml

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎app/ch14_testing/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch15_deploy/final/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

‎app/ch15_deploy/starter/pypi_org/data/db_session.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ def global_init(db_file: str):
1919
conn_str = 'sqlite:///' + db_file.strip()
2020
print("Connecting to DB with {}".format(conn_str))
2121

22-
engine = sa.create_engine(conn_str, echo=False)
22+
# Adding check_same_thread = False after the recording. This can be an issue about
23+
# creating / owner thread when cleaning up sessions, etc. This is a sqlite restriction
24+
# that we probably don't care about in this example.
25+
engine = sa.create_engine(conn_str, echo=False, connect_args={"check_same_thread": False})
2326
__factory = orm.sessionmaker(bind=engine)
2427

2528
# noinspection PyUnresolvedReferences

0 commit comments

Comments
 (0)
Please sign in to comment.