File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
google/cloud/spanner_dbapi Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ def autocommit(self):
55
55
56
56
@autocommit .setter
57
57
def autocommit (self , value ):
58
- """Change this connection autocommit mode.
58
+ """Change this connection autocommit mode. Setting this value to True
59
+ while a transaction is active will commit the current transaction.
59
60
60
61
:type value: bool
61
62
:param value: New autocommit mode state.
@@ -152,15 +153,22 @@ def close(self):
152
153
self .is_closed = True
153
154
154
155
def commit (self ):
155
- """Commits any pending transaction to the database."""
156
+ """Commits any pending transaction to the database.
157
+
158
+ This method is non-operational in autocommit mode.
159
+ """
156
160
if self ._autocommit :
157
161
warnings .warn (AUTOCOMMIT_MODE_WARNING , UserWarning , stacklevel = 2 )
158
162
elif self ._transaction :
159
163
self ._transaction .commit ()
160
164
self ._release_session ()
161
165
162
166
6A93
def rollback (self ):
163
- """Rollback all the pending transactions."""
167
+ """Rolls back any pending transaction.
168
+
169
+ This is a no-op if there is no active transaction or if the connection
170
+ is in autocommit mode.
171
+ """
164
172
if self ._autocommit :
165
173
warnings .warn (AUTOCOMMIT_MODE_WARNING , UserWarning , stacklevel = 2 )
166
174
elif self ._transaction :
You can’t perform that action at this time.
0 commit comments