Is there any way to avoid having to follow that commit() up the
threads? My main thread is waiting on socket connections and can't be
trusted to commit any time I want. For convenience's sake on a number
of levels I'd really like to just be able to have independent database
interactions for some threads. Is that at all possible or reasonable?

On Apr 14, 3:39 am, "Diez B. Roggisch" <[email protected]> wrote:
> Am 14.04.2010 um 03:38 schrieb Alex Karpinski:
>
> > I worry that I have a fundamental misunderstanding of Elixir and
> > SQLAlchemy. I'm having issues in a multithreaded server.
>
> > My model looks like this (nothing pretty, but it does what I want, at
> > least for testing):
> >http://pastry.se/450001/
>
> See this for a working example:
>
>    http://pastry.se/410002/
>
> Two issues, one of them you did wrong, and one you probably did wrong:
>
>   - The declaration of 1:n-relationships was messed up, use OneToMany  
> and ManyToOne. You used
> Message.ManyToOne("User") (correct), but then  
> User.ManyToMany("Message"). Set metadata.bind.echo = True to see how  
> that creates a wrong data-model
>
>   - you need to commit sessions in the main-thread because otherwise  
> you always stay in one transaction & the DB shields you from changes  
> in other transactions. Depending on the transaction-model of course.
>
> Diez

-- 
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en.

Reply via email to