UnboundExecutionError when using Vertical Properties and scoped_session

Issue #1182 resolved
Former user created an issue

I'm using 0.5rc1 sqlalchemy with python 2.4

I modified the dictlike-polymorphic.py example to illustrate the problem. I'm not sure if it will reproduce as is, or if you will have to modify the data somewhat, but I'll explain how to do that.

The script as uploaded dies with "sqlalchemy.exc.UnboundExecutionError: Instance AnimalFact@0x6ea570 is not bound to a Session; attribute refresh operation cannot proceed" when run on my system. If I tweak the data (making pri_key=u'aaa' for example) then it completes all ten passes. If I switch back to using create_session() I can't get it to fail at all.

If the bug doesn't reproduce for you when you try it, try lengthening pri_key, using pri_key.encode('utf-8') in the for loop, or wrapping VerticalPropertyDictMixin.getitem in a try:except: pass. All of these changes seem to have altered the behavior in some way making me think it may be a race condition.

Comments (3)

  1. Mike Bayer repo owner

    expanded the window of "check for object reference gone" in 7005a9a42fdf46fbd6925c995300c01ae56995f9.

    unfortunately I can't make a reliable unit test on this one since I can bring the script down, but as soon as I remove the docstring for Animal, the error ceases to occur, so that's total Python VM artifacty stuff. Strategic placement of gc's don't do it either, the weakref really has to get asynchronously yanked at a very specific moment.

  2. Log in to comment