Michael Bayer wrote:
> there seems to be more going on there, but perhaps are all side effects of
> the same thing:
>
> http://www.sqlalchemy.org/trac/wiki/FAQ#MySQLserverhasgoneawaypsycopg.InterfaceError:connectionalreadyclosed
>
> or otherwise your mysql client is not able to connect at all.
I have switched to trying postgresql, to see what shows up.

The new problem being that it appears I have WAY TOO MANY processes open
to the database being made:

braydon  24226  0.2  8.5 339524 33536 pts/2    Sl   Feb04   0:13 python
http_server.py
postgres 24229  0.0  1.7 102416  6968 ?        Ss   Feb04   0:00
postgres: braydon braydon 127.0.0.1(35089) idle in transaction
postgres 24233  0.0  1.6 102300  6356 ?        Ss   Feb04   0:00
postgres: braydon braydon 127.0.0.1(35093) idle
postgres 24277  0.0  1.2 101876  4836 ?        Ss   Feb04   0:00
postgres: braydon braydon 127.0.0.1(35564) idle
postgres 24412  0.0  1.2 101876  4840 ?        Ss   00:02   0:00
postgres: braydon braydon 127.0.0.1(59737) idle
postgres 24483  0.0  1.2 101876  4836 ?        Ss   00:17   0:00
postgres: braydon braydon 127.0.0.1(53032) idle
postgres 24547  0.0  1.2 101876  4840 ?        Ss   00:32   0:00
postgres: braydon braydon 127.0.0.1(33366) idle
postgres 24675  0.0  1.2 101876  4840 ?        Ss   01:00   0:00
postgres: braydon braydon 127.0.0.1(54586) idle
postgres 24676  0.0  1.2 101880  4840 ?        Ss   01:00   0:00
postgres: braydon braydon 127.0.0.1(54589) idle
postgres 24677  0.0  1.2 101876  4828 ?        Ss   01:00   0:00
postgres: braydon braydon 127.0.0.1(54591) idle
postgres 24736  0.0  1.2 101876  4832 ?        Ss   01:12   0:00
postgres: braydon braydon 127.0.0.1(51563) idle
postgres 24741  0.0  1.2 101876  4840 ?        Ss   01:13   0:00
postgres: braydon braydon 127.0.0.1(51579) idle
postgres 24743  0.0  1.2 101876  4844 ?        Ss   01:13   0:00
postgres: braydon braydon 127.0.0.1(51585) idle
postgres 24756  0.0  1.2 101876  4844 ?        Ss   01:15   0:00
postgres: braydon braydon 127.0.0.1(42054) idle
postgres 24773  0.0  0.5 100724  2148 ?        Ds   01:18   0:00
postgres: autovacuum worker process


I am using the following to establish get the database going:

import cherrypy

from sparrow.settings import Settings
from sparrow.database import Database
from sparrow.templates import render

db = Database()
settings = Settings()

class Root():
    def __init__(self):
        self.cmd = __import__('exposed', globals(), locals(),['sparrow'])
    db.create_all()

    def default(self, *args, **kwargs):
        location_st = ""
        for arg in args:
            location_st += "/"+arg
        try:
            return render(args, kwargs, location_st)
        except:
            db.start_engine()
            return render(args, kwargs, location_st)
    default.exposed = True

This is the wrong way to go about insuring
that there is a DB connection. I'd like to know the correct way.
Would this be to test the database, and if that fails to open a connection?




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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