python-postgres / be

pg-python: Execute Python 3 code from PostgreSQL functions.
Other
5 stars 2 forks source link

Stateful does not function properly in cases where used more than once #18

Closed jwp closed 14 years ago

jwp commented 14 years ago

Specifically:

@Stateful def foo(): pass

@Stateful def main(): yield foo()

Should result in an exception--max stack depth. main's state is recorded in fi_state and foo() will end up referencing main's generator.

jwp commented 14 years ago

Currently planning to fix this by adding an fi_state_owner field. When a call state using object is invoked in the presence of an existing owner, it will raise a runtime error.

jwp commented 14 years ago

2d0accd54592739499180aecd5e932cdffb52914