Hi,
I'm fairly new to Python and Storm and seeing some problems on my MySQL
database-- I get
"SQL Error 1040: Too Many Connection"
I'm trying to wrap Storm in a class called Repository that is so far
pretty simple:
class Repository(object):
def __init__(self, url):
database = create_database(url)
self.store = Store(database)
def update(self, domain):
self.store.add(domain)
self.store.commit()
def findById(self, klasses, id):
conds = [k.id == id for k in klasses]
result = self.store.find(tuple(klasses), *conds)
klass_dict = dict((r.__class__, r) for r in result.one())
return klass_dict
But I'm wondering where is the best place in the application to close a
connection, can I use a destructor or something? Note, I'm not building
a webapp, in fact I'm just writing python "tasks" that will execute and
complete before another task gets launched so looks like closing any db
connections is pretty critical.
Thanks, Jason
--
storm mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/storm