Thread: [SQLObject] Commit on main connection
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: John B. <bre...@mc...> - 2010-02-12 18:57:22
|
Hello, I would like to disable autocommit on my underlying database connection. What method do I use to force a commit on the connection? I realize that a transaction object has a commit() method, but how do I do a similar thing with the connection i acquired via: sqlhub.processConnection = connectionForURI(config.dburl) Thanks, John |
From: Oleg B. <ph...@ph...> - 2010-02-12 19:17:58
|
On Fri, Feb 12, 2010 at 08:57:06AM -1000, John Bresnahan wrote: > I would like to disable autocommit on my underlying database connection. What method do I use to > force a commit on the connection? I realize that a transaction object has a commit() method, but > how do I do a similar thing with the connection i acquired via: > > sqlhub.processConnection = connectionForURI(config.dburl) The object created by connectionForURI() is not a DB API connection but an instance of SQLObject's class DBConnection; it's a high-level object that remembers connection parameters; it opens and closes real DB connections when they are needed, it maintains a pool of opened connections (for multithreaded applications, e.g.). But it cannot be committed because it's not a real connection (what low-level connection from the pool are to be committed?) Use transactions. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |