24 Jun 11:50
Using __connection__ in a multi-thread application
Alex <xktybot <at> gmail.com>
2009-06-24 09:50:29 GMT
2009-06-24 09:50:29 GMT
Is it thread safe to define __connections__ on the startup of a server
for the later use in multiple threads?
...
__connection__ = connectionForURI(connection_string)
class Person(SQLObject):
...
class MultithreadAppUsingPerson:
...
persons = Person.select()
...
aMultithreadAppUsingPerson.run()
If it's not ok, how can I predefine connection for each thread without
the necessity to pass the connection explicitly on every
instantiation? I would really like to workaround the straightforward
code-consuming approach.
------------------------------------------------------------------------------
RSS Feed