Hi,

the subject pretty much says it all. We just discovered that when trying to 
implement a backoffice system that requires objects to be shared between 
threads.

Yes, we are aware of the dangers that imposes. 

Yet we need this to keep data around & occasionally update. The  updating is 
then governed by a lock to prevent any MT-related troubles.

However, using Entity & setup_all puked on us, the error message being 

Exception: Failed to map entity 'Test' with its table or selectable. The code 
is below.

Changing the session to a scoped session makes the test pass.

This however is *not* a limitation imposed by SA! We switched to declarative 
mapping for this project - and it works.

Now - are there any technical reasons for Elixir behaving like this, or is it 
just an oversight? Would a patch be accepted?

Diez

======= example =========


import elixir
from sqlalchemy.orm import sessionmaker
from sqlalchemy import create_engine
from elixir import Unicode, Entity, Field, using_table_options, using_options

engine = create_engine("sqlite:////tmp/test.dat")
elixir.metadata.bind = engine

elixir.session = sessionmaker(bind=engine)



class Test(Entity):

    #using_options(session=elixir.session)
    name = Field(Unicode(length=100))


elixir.setup_all()
elixir.create_all()

--~--~---------~--~----~------------~-------~--~----~
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