|
From: <le...@as...> - 2004-12-06 19:51:48
|
Hello guyz,
I am having a trouble with autocommit, the problem is:
I want that autocommit be alway on. Then i did a function called
atomic_start, that turn autocommit off and make the next commands a
transaction, so when i call atmic_commit, it commits,
self.connection.commit. But i see that i cant change autocommit after i
have activate a cursor, see:
AttributeError: Can't change autocommit when a cursor is active.
Any suggestion?
Cheers,
Breno Leitao
http://lcr.icmc.usp.br/~leitao
--
Async Open Source
(16) 3361 2331
São Carlos, SP
Brasil
Code:
def atomic_start(self):
self.connection.autocommit = 0
self.run_query(query)
def atomic_commit(self):
self.connection.commit()
self.connection.autocommit = 1
|