Hello.
I have an application - it store it's state in DB, when it need change
object - it need change in in DB and in "real world". So I create
session with autocommit=False, make changes for DB objects, make
changes on "real world" objects and if everything OK, commit session.
In theory everything must work... but in one case I was need to make
child process, and it broken everything. ^_^
1. db_ses = Session(autocommit=False)
2. # make some manipulations with DB objects
3. pid = os.fork()
4. if pid == 0:
5. # make some manipulation on real objects. Not using any DB
operations, sqlalchemy functiuons or mmaped objects
6. # sys.exit()
7. # wait to child complete it's job
8. db_ses.commit()
On step 6, while child make exit it close DB connection. Parent
process was very unhappy by that. My code doesn't catch SystemExit, I
saw how it(SystemExit) leave my code and DB connection become closed
(see via DB logs).
When I change sys.exit() on os.execl('/bin/sh','/bin/sh') - child not
close connection, but steel close transaction(telling "rollback")...
How can I fix this? I need opened transaction and normal child
process.
python-2.6.2
sqlalchemy-0.5.5
psycopg-2.0.11
Linux gentoo(if this is important).
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---