Skip to content

Commit

Permalink
revert setting implicit transactions to on, fix raising exceptions re…
Browse files Browse the repository at this point in the history
…garding commit and rollback
  • Loading branch information
damoxc committed Feb 24, 2011
1 parent 06e1066 commit 19ff40c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Tue Nov 02 09:33:00 2010 Damien Churchill <[email protected]>
+ feature: remove the trusted parameter to connect()
+ feature: add returnvalue property with the result of a callproc()
call.
+ feature: fix raising exceptions when args[0] is not a string
* MANIFEST.in:
+ feature: include the tests
* setup.py:
Expand Down
3 changes: 1 addition & 2 deletions _mssql.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,7 @@ cdef class MSSQLConnection:
"SET ANSI_WARNINGS ON;" \
"SET ANSI_NULL_DFLT_ON ON;" \
"SET CURSOR_CLOSE_ON_COMMIT ON;" \
"SET QUOTED_IDENTIFIER ON;" \
"SET IMPLICIT_TRANSACTIONS ON;"
"SET QUOTED_IDENTIFIER ON;"
)

rtc = dbsqlexec(self.dbproc)
Expand Down
6 changes: 3 additions & 3 deletions pymssql.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ cdef class Connection:
try:
self._conn.execute_non_query('BEGIN TRAN')
except Exception, e:
raise OperationalError('Cannot start transation: %s' % e[0])
raise OperationalError('Cannot start transation: ' + str(e[0]))

def __del__(self):
if self.conn:
Expand Down Expand Up @@ -218,7 +218,7 @@ cdef class Connection:
self._conn.execute_non_query('COMMIT TRAN')
self._conn.execute_non_query('BEGIN TRAN')
except Exception, e:
raise OperationalError('Cannot commit transation: %s' % e[0])
raise OperationalError('Cannot commit transation: ' + str(e[0]))

def cursor(self, as_dict=None):
"""
Expand All @@ -240,7 +240,7 @@ cdef class Connection:
self._conn.execute_non_query('ROLLBACK TRAN')
self._conn.execute_non_query('BEGIN TRAN')
except Exception, e:
raise OperationalError('Cannot roll back transation: %s' % e[0])
raise OperationalError('Cannot roll back transation: ' + str(e[0]))


##################
Expand Down

0 comments on commit 19ff40c

Please sign in to comment.