A context manager for executing a transaction on this Database.
351816
def transaction(self):
        """"""

        conn = self.get_connection()
        tx = conn.transaction()
        try:
            yield conn
            tx.commit()
        except:
            tx.rollback()
        finally:
            conn.close()
304875
def transaction_from_context(context)
      classname = (context["wrapped"] || context["class"] ||
                    (context[:job] && (context[:job]["wrapped"] || context[:job]["class"]))
                  )
      if classname
        "Sidekiq/#{classname}"
      elsif context[:event]
        "Sidekiq/#{context[:event]}"
      else
        "Sidekiq"
      end
    end
1099347
def execute_and_commit(*args, **kwargs):
        
        db, cursor = CoyoteDb.execute(*args, **kwargs)
        db.commit()
        return cursor
1319921
async def execute(self, stmt, *args):
        
        with (await self.application.db.cursor()) as cur:
            await cur.execute(stmt, args)
73047
def _cursor(self, *args, **kwargs):
        """"""
        # The args and kwargs are not part of the standard,
        # but some database modules seem to use these.
        transaction = self._transaction
        if not transaction:
            self._ping_check(2)
        try:
            if self._maxusage:
                if self._usage >= self._maxusage:
                    # the connection was used too often
                    raise self._failure
            cursor = self._con.cursor(*args, **kwargs)  # try to get a cursor
        except self._failures as error:  # error in getting cursor
            try:  # try to reopen the connection
                con = self._create()
            except Exception:
                pass
            else:
                try:  # and try one more time to get a cursor
                    cursor = con.cursor(*args, **kwargs)
                except Exception:
                    pass
                else:
                    self._close()
                    self._store(con)
                    if transaction:
                        raise error  # re-raise the original error again
                    return cursor
                try:
                    con.close()
                except Exception:
                    pass
            if transaction:
                self._transaction = False
            raise error  # re-raise the original error again
        return cursor
882598
private TransactionContext getOrCreateTransactionContext()
   {
      TransactionContext ctx = contexts.get();
      if (ctx == null)
      {
         // No transaction context exists so we create a new one
         ctx = new TransactionContext();
         contexts.set(ctx);
      }
      return ctx;
   }
754342
def execute(self, operation, params=()):
        
        conn = self._assert_open()
        conn._try_activate_cursor(self)
        self._execute(operation, params)
        # for compatibility with pyodbc
        return self
1043651
async def executemany(self, sql: str, parameters: Iterable[Iterable[Any]]) -> None:
        """"""
        await self._execute(self._cursor.executemany, sql, parameters)
1184959
def commit(using=None):
    
    try:
        django.db.transaction.commit(using)
    except django.db.transaction.TransactionManagementError:
        pass
986963
public void startTransaction()
   {
      Long key = Long.valueOf(Thread.currentThread().getId());
      TransactionImpl tx = txs.get(key);

      if (tx == null)
      {
         TransactionImpl newTx = new TransactionImpl(key);
         tx = txs.putIfAbsent(key, newTx);
         if (tx == null)
            tx = newTx;
      }

      tx.active();
   }
536296
protected void executeStatements(TestContext context) {
        for (String stmt : statements) {
            try {
                final String toExecute = context.replaceDynamicContentInString(stmt.trim());

                if (log.isDebugEnabled()) {
                    log.debug("Executing PLSQL statement: " + toExecute);
                }

                getJdbcTemplate().execute(toExecute);

                log.info("PLSQL statement execution successful");
            } catch (DataAccessException e) {
                if (ignoreErrors) {
                    log.warn("Ignoring error while executing PLSQL statement: " + e.getMessage());
                    continue;
                } else {
                    throw new CitrusRuntimeException("Failed to execute PLSQL statement", e);
                }
            }
        }
    }
1249456
def execute(self, conn, transaction=False):
        
        sql = self.sql
        binds = {}
        
	cursors = self.dbi.processData(sql, binds, conn, transaction, returnCursor=True)
        result = []
        for c in cursors:
            result.extend(self.formatCursor(c, size=100))
        return result
374374
def transaction
      transaction = database.create_transaction(transaction_code,
                                                write: write_collections,
                                                read:  read_collections)
      transaction.wait_for_sync = true

      transaction
    end
474214
def execute_closing_transaction(statements: Iterable):
    """"""

    with closing(connect()) as conn:
        with conn.cursor() as cursor:
            for statement in statements:
                cursor.execute(statement)
1351567
private Object exec(StatementContext statement) {
    if (statement == null)
      return null;
    return statement.accept(visitor);
  }
1194234
def insert(self, context):
	
		
		
		status_code, msg = self.__endpoint.post(
			"/resources/jdbc-connection-pool",
			data={
				"id": self.__name,
				"resType": self.__res_type,
				"datasourceClassname": self.__ds_classname,
				"property": props_value(self.__props)
			}
		)
		self.__available = True
932287
def execute( self, conn, daoinput, transaction = False ):
        
        binds = {} 
        bindlist=[]
        
        if isinstance(daoinput, dict) and "block_name" in daoinput.keys():
            binds = {"block_name": daoinput["block_name"]}
            r = self.dbi.processData(self.sql_sel, binds, conn, False)
            bfile = self.format(r)
            bfile_list = []
            for f in bfile:
                bfile_list.append(f[0])           
            if "child_parent_id_list" in daoinput.keys():
                files = []
                for i in daoinput["child_parent_id_list"]:
                    files.append(i[0])
                if set(files)-set(bfile_list):
                    dbsExceptionHandler('dbsException-invalid-input2', "Files required in the same block for FileParent/insert2 dao.", self.logger.exception) 
            else:
                dbsExceptionHandler('dbsException-invalid-input2', "child_parent_id_list required for FileParent/insert2 dao.", self.logger.exception) 
        else:
            dbsExceptionHandler('dbsException-invalid-input2', "Block_name required in the same block for FileParent/insert2 dao.", self.logger.exception)
        binds = {} 
        for pf in daoinput["child_parent_id_list"]:
            binds = {"this_file_id":pf[0], "parent_file_id": pf[1]}
            bindlist.append(binds) 
        self.dbi.processData(self.sql, bindlist, conn, transaction)