Example #1
0
 def commit(self, *args, **kwargs):
     ses = self.session()
     try:
        xid = ses.query(func.txid_current()).first()
        logger.info("Transaction id: %s" % xid)
        logger.debug("Commit")
     except Exception as e:
         logger.exception(e)
     return ses.commit(*args, **kwargs)
Example #2
0
 def commit(self, *args, **kwargs):
     ses = self.session()
     try:
         xid = ses.query(func.txid_current()).first()
         logger.info("Transaction id: %s" % xid)
         logger.debug("Commit")
     except Exception as e:
         logger.exception(e)
     return ses.commit(*args, **kwargs)
Example #3
0
def rollback():
    """
    Do database rollback
    """
    sessio = connection.session.session()
    if sessio.transaction.is_active:
        try:
            xid = sessio.query(func.txid_current()).first()
            logger.info("Transaction id: %s" % xid)
        except:
            pass
    logger.debug("Rollback due to error")
    sessio.rollback()
Example #4
0
def rollback():
    """
    Do database rollback
    """
    sessio = connection.session.session()
    if sessio.transaction.is_active:
        try:
            xid = sessio.query(func.txid_current()).first()
            logger.info("Transaction id: %s" % xid)
        except:
            pass
    logger.debug("Rollback due to error")
    sessio.rollback()