commit and return result. This is intended for sql UPDATE ... RETURNING
433301
def commitreturn(self,qstring,vals=()):
    ""
    with self.withcur() as cur:
      cur.execute(qstring,vals)
      return cur.fetchone()
416394
def commitreturn(self, cursor, qstring, vals=()):
    ""
    cursor.execute(qstring, vals)
    return cursor.fetchall()[0]
40039
def commit(self, commit):
		
		try:
			return self._commitData(self.repo.get_commit(commit))
		except (ValueError, KeyError, GithubException):
			raise KeyError("Commit %s not found" % commit)
794175
def _ReturnConnection(self):
		
		if self.conn is not None:
			if self.connInfo.commitOnEnd is True or self.commitOnEnd is True:
				self.conn.Commit()
					
			Pool().returnConnection(self.conn)
			self.conn = None
255234
@Override
  public void commit() throws IOException {
    try {
      LOG.info("Flushing pending insert.");
      this.commands.flush();
      LOG.info("Commiting transaction.");
      this.conn.commit();
    } catch (Exception e) {
      this.failed = true;
      throw new RuntimeException(e);
    }
  }
571391
def commit(self):
        
        assert self.record
        result = self.files_written, self.dirs_created
        self._init_record()
        return result
817472
@Override
  public boolean commit() {
    final CoreRemoteMongoCollection<DocumentT> collection = getCollection();
    final List<WriteModel<DocumentT>> writeModels = getBulkWriteModels();

    // define success as any one operation succeeding for now
    boolean success = true;
    for (final WriteModel<DocumentT> write : writeModels) {
      if (write instanceof ReplaceOneModel) {
        final ReplaceOneModel<DocumentT> replaceModel = ((ReplaceOneModel) write);
        final RemoteUpdateResult result =
            collection.updateOne(replaceModel.getFilter(), (Bson) replaceModel.getReplacement());
        success = success
            && (result != null && result.getModifiedCount() == result.getMatchedCount());
      } else if (write instanceof UpdateOneModel) {
        final UpdateOneModel<DocumentT> updateModel = ((UpdateOneModel) write);
        final RemoteUpdateResult result =
            collection.updateOne(updateModel.getFilter(), updateModel.getUpdate());
        success = success
            && (result != null && result.getModifiedCount() == result.getMatchedCount());
      } else if (write instanceof UpdateManyModel) {
        final UpdateManyModel<DocumentT> updateModel = ((UpdateManyModel) write);
        final RemoteUpdateResult result =
            collection.updateMany(updateModel.getFilter(), updateModel.getUpdate());
        success = success
            && (result != null && result.getModifiedCount() == result.getMatchedCount());
      }
    }
    return success;
  }
1321529
def _commit(self, session, errorMessage):
        
        try:
            session.commit()
        except IntegrityError:
            # Raise special error if the commit fails due to empty files
            log.error('Commit to database failed. %s' % errorMessage)
        except:
            # Raise other errors as normal
            raise
775571
public function commit()
    {
        // First we validate if every property has a handler
        foreach ($this->mutations as $propertyName => $value) {
            if (!isset($this->result[$propertyName])) {
                $this->failed = true;
                $this->result[$propertyName] = 403;
            }
        }

        foreach ($this->propertyUpdateCallbacks as $callbackInfo) {
            if ($this->failed) {
                break;
            }
            if (is_string($callbackInfo[0])) {
                $this->doCallbackSingleProp($callbackInfo[0], $callbackInfo[1]);
            } else {
                $this->doCallbackMultiProp($callbackInfo[0], $callbackInfo[1]);
            }
        }

        /*
         * If anywhere in this operation updating a property failed, we must
         * update all other properties accordingly.
         */
        if ($this->failed) {
            foreach ($this->result as $propertyName => $status) {
                if (202 === $status) {
                    // Failed dependency
                    $this->result[$propertyName] = 424;
                }
            }
        }

        return !$this->failed;
    }
1193892
public void commit() throws DBException
    {
        super.commit();   // Will throw an error if something is not set up right.
        try   {
            if (m_JDBCConnection != null)
                m_JDBCConnection.commit();
        } catch (SQLException ex) {
            throw this.convertError(ex);
        }
    }
360172
def execute(self, return_results=True):
        '''
        
        '''
        if self.results:
            return self.results if return_results else None

        self.execute_raw()

        if self._raw_results_only:
            self.results = self.raw_results
        else:
            self.map_results()

        if return_results:
            return self.results
1099347
def execute_and_commit(*args, **kwargs):
        
        db, cursor = CoyoteDb.execute(*args, **kwargs)
        db.commit()
        return cursor
837205
def execute(self, **kwargs):
    
    assert self.resp is None, "Transaction already committed"
    try:
      self.resp = self.db.tx(list(self.edn_iter), **kwargs)
    except Exception:
      self.resp = False
      raise
    else:
      self.resolve()
      self.adds = None
      self.tmpents = None
    return self.resp
764036
private CommitResult commitTransaction(TransactionScope<K> transactionScope) {
    TransactionLog<MapUpdate<K, byte[]>> transactionLog = transactionScope.transactionLog();
    boolean retainTombstones = !activeTransactions.isEmpty();

    List<AtomicMapEvent<K, byte[]>> eventsToPublish = Lists.newArrayList();
    for (MapUpdate<K, byte[]> record : transactionLog.records()) {
      if (record.type() == MapUpdate.Type.VERSION_MATCH) {
        continue;
      }

      K key = record.key();
      checkState(preparedKeys.remove(key), "key is not prepared");

      if (record.type() == MapUpdate.Type.LOCK) {
        continue;
      }

      MapEntryValue previousValue = entries().remove(key);

      // Cancel the previous timer if set.
      cancelTtl(previousValue);

      MapEntryValue newValue = null;

      // If the record is not a delete, create a transactional commit.
      if (record.type() != MapUpdate.Type.REMOVE_IF_VERSION_MATCH) {
        newValue = new MapEntryValue(MapEntryValue.Type.VALUE, currentVersion, record.value(), 0, 0);
      } else if (retainTombstones) {
        // For deletes, if tombstones need to be retained then create and store a tombstone commit.
        newValue = new MapEntryValue(MapEntryValue.Type.TOMBSTONE, currentVersion, null, 0, 0);
      }

      AtomicMapEvent<K, byte[]> event;
      if (newValue != null) {
        entries().put(key, newValue);
        if (!valueIsNull(newValue)) {
          if (!valueIsNull(previousValue)) {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.UPDATE,
                key,
                toVersioned(newValue),
                toVersioned(previousValue));
          } else {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.INSERT,
                key,
                toVersioned(newValue),
                null);
          }
        } else {
          event = new AtomicMapEvent<>(
              AtomicMapEvent.Type.REMOVE,
              key,
              null,
              toVersioned(previousValue));
        }
      } else {
        event = new AtomicMapEvent<>(
            AtomicMapEvent.Type.REMOVE,
            key,
            null,
            toVersioned(previousValue));
      }
      eventsToPublish.add(event);
    }
    publish(eventsToPublish);
    return CommitResult.OK;
  }
1180483
def commit(self, commit):
		
		try:
			return self._commitData(self.repo.commit(commit))
		except (ValueError, KeyError, BadObject):
			if self._repo_info:
				raise KeyError("Commit %s not found for %s" % (commit, str(self._repo_info)))
			else:
				raise KeyError("Commit %s not found" % commit)
72631
def query(self, sql):
        '''
        
        '''
        try:
            self.connect()
            with self.con.cursor() as cursor:
                cursor.execute(sql)
                self.con.commit()
                res = cursor.fetchall()
                return res
        except Exception as e:
            print(e)
            return -1
        finally:
            self.close()
78099
protected function commit_transaction() {
        if (!$this->transactions_supported()) {
            return;
        }

        $sql = "COMMIT";
        $this->query_start($sql, NULL, SQL_QUERY_AUX);
        $result = $this->mysqli->query($sql);
        $this->query_end($result);
    }