On Dec 19, 2009, at 4:50 PM, drakkan wrote: > On 16 Dic, 19:03, "Michael Bayer" <[email protected]> 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 = create_engine(connectionstring, echo=settings.DEBUG, >> >> this line: >> >>> pool=NullPool(lambda: sqlite3.connect(settings.DATABASE_PATH))) >> >> negates the effect of the "check_same_thread" flag in this line since the >> fully constructed pool + creation function you're sending means the URL >> isn't used: >> >>> engine = create_engine(connectionstring, echo=settings.DEBUG, >> >> you only need "pool_class=NullPool" in your create_engine here. Example >> here:http://www.sqlalchemy.org/trac/wiki/DatabaseNotes#SQLite > > thanks, this way works better but there is another problem: > > 1) I make a long select in a separate thread > 2) before 1) complete I make an insert or a delete in the main thread > 3) when I commit the changes in 2) if the select is still running I > get "The transaction is inactive due to a rollback in a > subtransaction. Issue rollback() to cancel the transaction."
that means an exception was thrown within flush(), the transaction was rolled back, and the exception rethrown. it should propagate outwards where you can catch it, or otherwise it will halt the application and dump to stderr. if you catch it and ignore it, you get that error when you attempt to continue. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
