The method that works 95% of the time is, just establish a connection to the
database, start a transaction, do some work that stays within the thread,
commit the transaction. Then throw all loaded state in that thread away, and
reload it all on the next transaction.
Its only if you
Hey guys -
I forgot about the really obvious way to do this - class decorators:
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
def common_columns(cls):
cls.created_at = Column(DateTime,
On 16 Dic, 19:03, Michael Bayer mike...@zzzcomputing.com wrote:
drakkan wrote:
Hi,
connectionstring = 'sqlite:///' + settings.DATABASE_PATH+'?
check_same_thread=False'
#engine = create_engine(connectionstring, echo=settings.DEBUG,
echo_pool=settings.DEBUG)
engine =
On Dec 19, 2009, at 4:50 PM, drakkan wrote:
On 16 Dic, 19:03, Michael Bayer mike...@zzzcomputing.com wrote:
drakkan wrote:
Hi,
connectionstring = 'sqlite:///' + settings.DATABASE_PATH+'?
check_same_thread=False'
#engine = create_engine(connectionstring, echo=settings.DEBUG,
On 20 Dic, 00:03, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 19, 2009, at 4:50 PM, drakkan wrote:
On 16 Dic, 19:03, Michael Bayer mike...@zzzcomputing.com wrote:
drakkan wrote:
Hi,
connectionstring = 'sqlite:///' + settings.DATABASE_PATH+'?
check_same_thread=False'
On Dec 19, 2009, at 6:20 PM, drakkan wrote:
Sorry, I don't fully understand you answer:
I have a main application that start a new thread to do a long running
task, while the thread is running the main app do other things and
when it commit the changes the thread has an exception caused
Thanks I found my error:
I defined my session as scoped session but in a global file I was
redefining it as session=sess() and session was not more scoped
On 20 Dic, 00:37, Michael Bayer mike...@zzzcomputing.com wrote:
On Dec 19, 2009, at 6:20 PM, drakkan wrote:
Sorry, I don't fully