Mark connections in pool as closed to prevent reuse

Needs further discussion

Example Script 

```python
from sqlalchemy import *
engine = create_engine("exa+pyodbc://", pool_size=1)
con = engine.connect()
print con.execute("select 1").fetchall()
con.close()
# in exaplusgui
# select * from exa_all_sessions;
# kill session XXXX;
raw_input("Kill session in exaplus and Press button to continue")
con = engine.connect()
try:
    print con.execute("select 1").fetchall()
except Exception as e:
    #[40004] [EXASOL][EXASolution driver]Connection lost.
    print e
finally:
    con.close()
con = engine.connect()
print con.execute("select 1").fetchall()
#[HY000] [EXASOL][EXASolution driver]Socket closed by peer
````
Hi!

Yes, there is some ODBC call. Use SQLGetConnectAttr() to query the 
attribute SQL_ATTR_CONNECTION_DEAD.

http://msdn.microsoft.com/en-us/library/ms710297%28v=vs.85%29.aspx 
(SQLGetConnectAttr)
http://msdn.microsoft.com/en-us/library/ms713605%28v=vs.85%29.aspx 
(attributes explained)

It has been a while, but I think I remember using this call with Exasol 
and the attribute was not supported or something like that.

Cheers

Michael



Am 07.08.2014 09:58, schrieb exaSR:
>
> In sqlalchemy_exasol/pyodbc.py:
>
> > @@ -102,4 +102,11 @@ def create_connect_args(self, url):
> >          connectors.extend(['%s=%s' % (k, v) for k, v in six.iteritems(keys)])
> >          return [[";".join(connectors)], connect_args]
> >
> > +    def is_disconnect(self, e, connection, cursor):
> > +        messages = [
> > +            "[HY000] [EXASOL][EXASolution driver]Socket closed by peer.",
> > +            "[40004] [EXASOL][EXASolution driver]Connection lost."
>
> Hi jk, no need for extra pulling in this case, I'm on it.
>
> I remember there should be some ODBC call to determine whether the 
> connection is actually connected or not. I'll try to get you some info 
> on this or on error codes.
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/blue-yonder/sqlalchemy_exasol/pull/22/files#r15922676>.
>


-- 

Dr. Michael König
Software Engineer

*Blue Yonder GmbH*
Ohiostraße 8
76149 Karlsruhe

Tel +49 (0) 721 383 117 38
Fax +49 (0) 721 383 117 69

michael.koenig@blue-yonder.com  <mailto:%20michael.koenig@blue-yonder.com>
www.blue-yonder.com  <http://www.blue-yonder.com>
Registergericht Mannheim, HRB 704547
USt-IdNr. DE 277 091 535
Geschäftsführer: Jochen Bossert, Uwe Weiss (CEO)