Hi everyone,

I've been using SQL alchemy for a while now, and haven't really had
any issues until recently.  Today, I was trying to connect to a bio-
informatic database that I use regularly, and got this message.  I got
the same message after restarting my machine (actually, Ubuntu didn't
want to restart and I had to manually turn off the computer.)

Any idea what might be causing the problem?  The function I use is
this:

def create_db_connection():
    user = "go_select"
    password = "amigo"
    port = "4085"
    db = "go_latest"
    host = "mysql.ebi.ac.uk"

    conn_str = ("mysql+mysqldb://" + user + ":" + password + "@" +
host + ":"
                + port +  "/" + db)
    db = create_engine(conn_str)
    #db.echo = True
    connection = db.connect()
    return connection

GO_connection = go.create_db_connection()

which causes a huge error, culminating in:

Traceback (most recent call last):
  File "/home/federicov/eclipse_workspace/fission-yeast-network-
analysis/Polarity Cell-Cycle and Cytokinesis/src/Workflow/
Workflow.py", line 48, in <module>
    GO_connection = go.create_db_connection()
  File "/home/federicov/eclipse_workspace/fission-yeast-network-
analysis/Polarity Cell-Cycle and Cytokinesis/src/bioinfotools/queries/
gene_ontology.py", line 20, in create_db_connection
    connection = db.connect()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/engine/base.py", line 2266, in connect
    return self._connection_cls(self, **kwargs)
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/engine/base.py", line 872, in __init__
    self.__connection = connection or engine.raw_connection()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/engine/base.py", line 2352, in raw_connection
    return self.pool.unique_connection()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 169, in unique_connection
    return _ConnectionFairy(self).checkout()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 370, in __init__
    rec = self._connection_record = pool._do_get()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 696, in _do_get
    con = self._create_connection()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 174, in _create_connection
    return _ConnectionRecord(self)
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 255, in __init__
    self.connection = self.__connect()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/pool.py", line 315, in __connect
    connection = self.__pool._creator()
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/engine/strategies.py", line 80, in connect
    return dialect.connect(*cargs, **cparams)
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
sqlalchemy/engine/default.py", line 275, in connect
    return self.dbapi.connect(*cargs, **cparams)
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/__init__.py", line
81, in Connect
    return Connection(*args, **kwargs)
  File "/home/federicov/epd-python/lib/python2.7/site-packages/
MySQL_python-1.2.3-py2.7-linux-x86_64.egg/MySQLdb/connections.py",
line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
sqlalchemy.exc.OperationalError: (OperationalError) (1040, 'Too many
connections') None None

Is there any way I can close the existing connections on my end?  Mind
you, until today, I've never had a similar error, so I don't really
know what's different from usual.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to