Menu

#425 [Python] set autocommit failed using self.con.set_autocommit('OFF')

open
nobody
None
5
2013-02-24
2013-02-24
Jira Trac
No

[Python] set autocommit failed using self.con.set_autocommit('OFF')

Test Case: http://svn.cubrid.org/cubridapis/python/branches/RB-9.1.0/tests2/python/_12_autocommit/test_auocommit_01.py

Test Build: 9.1.0.0203
Test OS: Linux and windows
python driver: 9.1.0.0001

Test codes:
{code}
def test_03errorRollback(self):
print \nset_autocommit is not correct
self.con.set_autocommit(False)
self.assertEqual(self.con.get_autocommit(), False, autocommit is off)
self.con.set_autocommit('ON')
self.assertEqual(self.con.get_autocommit(), True, autocommit is ON)
self.con.set_autocommit('OFF')
self.assertEqual(self.con.get_autocommit(), False, autocommit is off)
{code}

Test Result:
{noformat}
======================================================================
FAIL: test_03errorRollback (__main__.AutocommitTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File python\_12_autocommit\test_auocommit_01.py, line 87, in test_03errorRollback
self.assertEqual(self.con.get_autocommit(), False, autocommit is off)
AssertionError: autocommit is off

----------------------------------------------------------------------
{noformat}

self.con.set_autocommit('ON') can set autocommit to True.
But self.con.set_autocommit('OFF') can not set autocommit to False.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.