i'm using sqlalchemy through turbogears
turbogears doesn't have all-that-hot support for sqlalchemy yet, and
I can't stand its user visit/identity system, so i'm implementing my
own (sorry Kevin)
i've come up with the following way to handle what I want to do via
the cherrypy request phases
before_request_body
use sqlalchemy to load a session obj
=snip
on_end_resource
update the session object and commit
my problem is that where i snipped things in the middle, turbogears
does some stuff itself, i'm guessing there's a begin/commit or
something in there... and i wind up with this error
===
File "build/bdist.darwin-8.6.0-Power_Macintosh/egg/sqlalchemy/
mapping/unitofwork.py", line 147, in _validate_obj
InvalidRequestError: Detected a mapped object not present in the
current thread's Identity Map: '(<class 'myapp.model.Class'>,
('62dd49990089f0c3c4e57ff54984e55ec90ffa6e',), None)'. Use
objectstore.import_instance() to place deserialized instances or
instances from other threads
===
would anyone have a suggestion on how i can 'check out' a unit of
work and force it to persist?
I tried calling objectstore.begin() , hoping things would nest --
no luck
i tried creating explicit sessions using objectstore.Session --
also no luck
this might be impossible, i fear. but i'm hoping for the best.
| - - - - - - - - - - - - - - - - - - - -
| RoadSound.com / Indie-Rock.net
| Collaborative Online Management And Syndication Tools
| - - - - - - - - - - - - - - - - - - - -
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users