[SQLObject] Problems with transactions
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Cyril E. <cy...@de...> - 2004-08-30 09:13:00
|
Hello, again. Put it simply Transactions do not work. In fact you must have autoCommit=True to make them work. Here is a transcript of what happens when you set autoCommit=false: 1/Pool : ACQUIRE pool=[] 1/QueryIns: INSERT INTO Repository.Category (id, description, language, number) VALUES ('FR_FR.CAT1', 'Consultation', 'fr_FR', 'A') 1/Pool : RELEASE (implicit, autocommit=0) pool=[] 1/ROLLBACK: auto 1/Pool : ACQUIRE pool=[] 1/QueryOne: SELECT description, language, number FROM Repository.Category WHERE id = 'FR_FR.CAT1' 1/Pool : RELEASE (implicit, autocommit=0) pool=[] 1/ROLLBACK: auto The QueryOne request fails always because the INSERT request have been roll back. The reason is that SQLObject creates, and closes a connection for each SQL statement. Why this behaviour? Should it not be possible to open the database connection when creating the SQLObject connection and releasing it _only_ when its parent is destroyed by the client code? Again, I'm ready to go into the code but I need to know the method to send patches. Cyril Elkaim |