We have an application (Turbogears) that uses multiple databases.
A main (postgres/mysql) database for most data (TG + application) and
another
datbase (sqlite) used for tracking some file info.

The main database uses the standard turbogears session, however
we ran into trouble using the turbogear's session for the sqlist db.

Instead we defined its own session with
  db= 'sqlite:///blobdb.sqlite'
  BlobSession = sessionmaker(bind=db, autoflush=True,
transactional=True)

and perform  when needed.

   session = BloBSession()
   session.query (...)
  ...
   session.commit ()
   session.close()

This worked well under 0.4.X, but seems to have changed under 0.5beta1
as seen below:
=================================================
 File "/home/kgk/work/bisquik/generative/TG/bisquik/IS/blobsrv.py",
line 218, in accessPermission
    log.debug( 'user: %s, id: %s, owner: %s, perm: %s'%( str(userId),
str(id), str(binfo.owner), str(binfo.perm) )  )
  File "/home/kgk/work/bisquik/generative/python/lib/python2.4/site-
packages/SQLAlchemy-0.5.0beta1-py2.4.egg/sqlalchemy/orm/
attributes.py", line 123, in __get__
    return self.impl.get(instance_state(instance))
  File "/home/kgk/work/bisquik/generative/python/lib/python2.4/site-
packages/SQLAlchemy-0.5.0beta1-py2.4.egg/sqlalchemy/orm/
attributes.py", line 307, in get
    value = callable_()
  File "/home/kgk/work/bisquik/generative/python/lib/python2.4/site-
packages/SQLAlchemy-0.5.0beta1-py2.4.egg/sqlalchemy/orm/
attributes.py", line 866, in __call__
    class_manager.deferred_scalar_loader(self, [
  File "/home/kgk/work/bisquik/generative/python/lib/python2.4/site-
packages/SQLAlchemy-0.5.0beta1-py2.4.egg/sqlalchemy/orm/mapper.py",
line 1580, in _load_scalar_attributes
    raise sa_exc.UnboundExecutionError("Instance %s is not bound to a
Session; attribute refresh operation cannot proceed" %
(state_str(state)))
UnboundExecutionError: Instance [EMAIL PROTECTED] is not bound to a
Session; attribute refresh operation cannot proceed

=================================================

Are we setting up the multiple database situation incorrectly for 0.5?

Thx,
Kris

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to