diff options
| author | Ryan Lucio <rlucio@internap.com> | 2010-12-29 15:04:21 -0800 |
|---|---|---|
| committer | Ryan Lucio <rlucio@internap.com> | 2010-12-29 15:04:21 -0800 |
| commit | c1acb68ef54309584816fbf5c93e38266accb2f0 (patch) | |
| tree | 11a6107b0638c753390de9aa02e3118a0988279e | |
| parent | 9a84a2bb4abb73d4022dbc8d699600f07d19267e (diff) | |
Add the pool_recycle setting to enable connection pooling features for the sql engine. The setting is hard-coded to 3600 seconds (one hour) per the recommendation provided on sqlalchemy's site
| -rw-r--r-- | nova/db/sqlalchemy/session.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/nova/db/sqlalchemy/session.py b/nova/db/sqlalchemy/session.py index e0d84c107..5f31743cd 100644 --- a/nova/db/sqlalchemy/session.py +++ b/nova/db/sqlalchemy/session.py @@ -36,7 +36,7 @@ def get_session(autocommit=True, expire_on_commit=False): global _MAKER if not _MAKER: if not _ENGINE: - _ENGINE = create_engine(FLAGS.sql_connection, echo=False) + _ENGINE = create_engine(FLAGS.sql_connection, pool_recycle=3600, echo=False) _MAKER = (sessionmaker(bind=_ENGINE, autocommit=autocommit, expire_on_commit=expire_on_commit)) |
