Hi Michael,
Thanks... Indeed it works... As long as I am careful and close the session
after every flush (Something that make sense in the little application I am
writing) several non concurrent threads can access and use the session.
Cool
Cheers,
François
> François Wautier wrote:
>
François Wautier wrote:
> I moved the "connect" to the method handling the data and the problem
> disappeared.
yeah "connect()" should generally be localized as much as possible.
>
> It would be easy enough to make sure all the "flushes" are done in a single
> thread of execution, but can you
Hi Michael,
Thanks for the answers.
> also, when you say you "triggered" the problem, can you do that
> predictably ? can you send a small test program that does it every
> time ? otherwise it sounds like a threading thing (if thats at all
> possible).
>
Very much so. Everytime I run my budd
also, when you say you "triggered" the problem, can you do that
predictably ? can you send a small test program that does it every
time ? otherwise it sounds like a threading thing (if thats at all
possible).
On Oct 21, 2006, at 6:18 AM, François Wautier wrote:
>
> Hi Michael,
>
> Nope!
is there any chance the Connection youre using is being shared
between threads ? thats also not supported.
On Oct 21, 2006, at 6:18 AM, François Wautier wrote:
>
> Hi Michael,
>
> Nope! Nothing of that sort. I couldn't care less about transaction
> at this
> point.
>
> All I do is
>
>
Hi Michael,
Nope! Nothing of that sort. I couldn't care less about transaction at this
point.
All I do is
self.dbEng=sqlalchemy.create_engine(myurl,strategy='threadlocal')
#debug
self.dbEng.echo=True
try:
self.dbConn=self.dbEng.connect()
hey François -
are you using the SessionTransaction explicitly ? or connection.begin
() ? Ive tried many combinations, and the only way I can reproduce
the problem is by doing something incorrect:
c = engine.connect()
s = create_session(bind_to=c)
tran = c.begin
Hi Michael,
It seems I spoke too quickly.
The problem is now when I try to flush a second time with a new object.
Something like this
newguy=dbPeople()
session.save(newguy)
newguy.Lastname="Doe"
newguy.Firstname="John"
newguy.gender="Ambiguous"
Thanks for the patch... it works... so far
And sorry for the double post... my original email was held for a very long
time on some google host
Cheers,
François
> thats a bug. its because the flush() is closing the "connection" you
> passed to your session.
>
> heres a patch that fix
thats a bug. its because the flush() is closing the "connection" you
passed to your session.
heres a patch that fixes it, which i will try to commit later today but
i want to work up some test cases:
Index: lib/sqlalchemy/orm/session.py
==
10 matches
Mail list logo