From: Brian B. <ex...@gm...> - 2004-12-31 06:02:49
|
Oleg Broytmann wrote: > Looks ok. What is wrong in your case? I'm not sure if I have the specific code anymore, but I will try to reproduce it if necessary. The issue is described below. - Do only methods that are passed the transaction provided by conn.transaction() take advantage of it? If so, how do you insert new rows within a transaction? I can only see one way to create a new row, i.e.: Person(name='Brian'), but no way to pass this a transaction 'instance' (I tried a few different ways). Given the above question, I can't remember exactly on what code I settled in which I thought row creations were being done within a transaction. But I did a time.clock() in 3 places: before create/insert (t1), after create/insert (t2), and after commit (t3). The difference between t2 and t1 was very large, and the difference between t3 and t2 was close to 0. So, insertions were being auto-committed and thus not within the transaction. A better explanation of how to do this would be appreciated. -- Brian Beck Adventurer of the First Order |