[okfn-help] sqlalchemy model sessions

John Bywater john.bywater at appropriatesoftware.net
Fri Mar 14 08:58:18 GMT 2008


Hi Rufus,

I'm having trouble with sessions and threads.....

Do you mind if we move to having explicit sessions in microfacts? It 
would seem to solve the problem I'm experiencing where sqlalchemy 
bitches that my object:

"'X' is already attached to session 'Y' (this is 'Z')"

http://www.mail-archive.com/sqlalchemy-users@lists.sourceforge.net/msg03361.html

I regenerate this problem when I create from my web browser a second 
thread or a second factlet after having previously restarted paster. 
That is, when the create mode class makes a call to 
session.save(new_entity) only the first create request is successful, 
and succeeding requests all fail with this error. With the call is not 
made, the created object is never persistent, but there is no error.

Is the current model session config the Pylons project initial default, 
ie what paster pastes? We're having problems, so let's make it explicit?

Best wishes,

John.


-- 
Appropriate Software Foundation
Registered in England and Wales
17 Chapel Street, Hyde Cheshire
Company number: 04977110
W: appropriatesoftware.net
T: 0870 720 2944
M: 0781 139 2292





More information about the okfn-help mailing list