On Thu, Oct 25, 2018 at 9:26 AM Sebastian Meinhardt
<[email protected]> wrote:
>
> Thank you for the advice. I will surely try out all the suggestions to
> isolate the exact cause of the problem. Unfortunately, today of all days is
> the annual maintenance and the system is down. I will try to reproduce the
> problem on a similar system.
>
> According to our database administrator, idle connections are actively killed
> by some job running on the database. Thus, it is not a classic timeout or
> something between client and database, but the connection gets dropped by the
> database itself.
OK, so I believe your script should be using KILL SESSION, I've just
tried this and the effects are immediate:
>>> from sqlalchemy import *
>>> e = create_engine("oracle://scott:tiger@oracle1120")
>>> conn = e.connect()
>>> conn.scalar("select 1 from dual")
1
then in the DB console as SYS:
SQL> alter system kill session '118,59061';
then:
>>> conn.scalar("select 1 from dual")
Traceback (most recent call last):
File "/home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/base.py",
line 1193, in _execute_context
context)
File "/home/classic/dev/sqlalchemy/lib/sqlalchemy/engine/default.py",
line 509, in do_execute
cursor.execute(statement, parameters)
cx_Oracle.DatabaseError: ORA-00028: your session has been killed
.. etc
the response was immediate and the client was told exactly what had happened.
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.