[storm] two questions about which store an object can have
shawn bright
nephish at gmail.com
Thu Aug 16 18:22:48 BST 2007
OK,
i have a thread that looks like this:
def run(self):
time.sleep(5)
while 1:
out_commands = self.store.find(OutCommand)
for out_command in out_commands:
site = self.store.get(Site, out_command.site_id)
group = self.store.get(Group, site.group_id)
if site.status_sensor.radio_type == u'aero':
self.store.add(AeroOutbox(site.id,
out_command.command))
elif site.status_sensor.radio_type in [u'ss',
u'condensed']:
self.store.add(SerialOutbox(site.id,
out_command.command))
command = unicode("execute %s" % out_command.command)
data = '%s %s %s %s %s' % (group.name, site.site_name,
site.status_sensor.monitor,
command)
self.store.add(ControlHit(group.id, site.id, command))
self.store.remove(out_command)
logg(_dir, _pre, data)
self.store.commit()
time.sleep(.5)
when it get to the store.commit() line it warns me that out_command does not
belong to this store.
there should be no other processes accessing this table from my python
program, especially this thread.
Do store objects share a common connection to the database?
i have one thread that uses storm with the following lines
from storm import database
database.DEBUG = True
this gives me the actual queries in the terminal, but also for every other
thread.
is there a way to make DEBUG = True apply only to one thread, or only to one
store?
thanks
shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/storm/attachments/20070816/52f48de5/attachment.htm
More information about the storm
mailing list