def abort(self):
     """
     Aborts the transaction.
     
     @return: None
     """
     db.abortTransaction(self.txn)
 def retry(self):
     """
     Called by the application server whenever a transaction commit fails.
     
     @return: None
     
     @raise porcupine.serverExceptions.DBTransactionIncomplete:
         if the maximum number of transaction retries has been reached,
         as defined in the C{porcupine.ini} file.
     """
     while self._retries < db.db_handle.trans_max_retries:
         db.abortTransaction(self.txn)
         self._retries += 1
         time.sleep(0.05)
         self.txn = db.createTransaction()
         try:
             tmpActions, self.actions = copy.copy(self.actions), []
             dummy = [func(*args) for func,args in tmpActions]
             return
         except serverExceptions.DBTransactionIncomplete:
             pass
     else:
         raise serverExceptions.DBTransactionIncomplete
    def repl_commit(self, data):
        retries = 0
        while retries < db.db_handle.trans_max_retries:
            try:
                for sId in data[1].keys():
                    if data[1][sId] != -1:
                        db.db_handle.repl_putExternalAttribute(sId, data[1][sId], self)
                    else:
                        db.db_handle.repl_deleteExternalAttribute(sId, self)

                for sId in data[0].keys():
                    if data[0][sId] != -1:
                        db.db_handle.repl_putItem(sId, data[0][sId], self)
                    else:
                        db.db_handle.repl_deleteItem(sId, self)
                    
                db.commitTransaction(self.txn)
                return
            except serverExceptions.DBTransactionIncomplete:
                db.abortTransaction(self.txn)
                self.txn = db.createTransaction()
                retries += 1
                time.sleep(0.05)
        raise serverExceptions.DBTransactionIncomplete
 def abort(self):
     db.abortTransaction(self.txn)