OK, <br><br>i have a thread that looks like this:<br><br> def run(self):<br> time.sleep(5)<br> while 1:<br> out_commands = self.store.find(OutCommand)<br> for out_command in out_commands:
<br> site = self.store.get(Site, out_command.site_id)<br> group = self.store.get(Group, site.group_id)<br> <br> if site.status_sensor.radio_type == u'aero':
<br> self.store.add(AeroOutbox(<a href="http://site.id">site.id</a>, out_command.command))<br> <br> elif site.status_sensor.radio_type in [u'ss', u'condensed']:
<br> self.store.add(SerialOutbox(<a href="http://site.id">site.id</a>, out_command.command))<br> <br> command = unicode("execute %s" % out_command.command)
<br> data = '%s %s %s %s %s' % (<a href="http://group.name">group.name</a>, site.site_name,<br> site.status_sensor.monitor, command)<br><br>
self.store.add(ControlHit(<a href="http://group.id">group.id</a>, <a href="http://site.id">site.id</a>, command))<br> self.store.remove(out_command)<br> logg(_dir, _pre, data)<br>
self.store.commit()<br> time.sleep(.5)<br><br>when it get to the store.commit() line it warns me that out_command does not belong to this store.<br>there should be no other processes accessing this table from my python program, especially this thread.
<br><br>Do store objects share a common connection to the database? <br><br>i have one thread that uses storm with the following lines<br>from storm import database<br>database.DEBUG = True<br><br>this gives me the actual queries in the terminal, but also for every other thread.
<br>is there a way to make DEBUG = True apply only to one thread, or only to one store?<br><br>thanks<br>shawn<br><br><br><br><br>