diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-04 13:59:32 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-02-04 13:59:32 -0500 |
commit | c70d7226ee1ced742b0ef4536e2c33aa480a437f (patch) | |
tree | c879582e9f5bcb3748d15233e7e69593ef365b4e | |
parent | fd07c22e6e104b2d8f295e2e4a8ca19d7f218513 (diff) | |
download | sqlalchemy-c70d7226ee1ced742b0ef4536e2c33aa480a437f.tar.gz |
- add a session killer for oracle provisioning
-rw-r--r-- | lib/sqlalchemy/testing/provision.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/provision.py b/lib/sqlalchemy/testing/provision.py index 0feb41987..588a5e112 100644 --- a/lib/sqlalchemy/testing/provision.py +++ b/lib/sqlalchemy/testing/provision.py @@ -258,6 +258,11 @@ def _oracle_configure_follower(config, ident): @_drop_db.for_db("oracle") def _oracle_drop_db(cfg, eng, ident): with eng.connect() as conn: + for row in conn.execute( + "select sid, serial# from v$session " + "where username='%s'" % ident.upper()): + sid, serial = row + conn.execute("alter system kill session '%s, %s'" % (sid, serial)) conn.execute("drop user %s cascade" % ident) conn.execute("drop user %s_ts1 cascade" % ident) conn.execute("drop user %s_ts2 cascade" % ident) |