def commit(self):
        """
        Commits the transaction.
        
        @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:
            try:
#                if self._retries == 1:
#                    raise serverExceptions.DBTransactionIncomplete
                db.commitTransaction(self.txn)
                self._iscommited = True
                return
            except serverExceptions.DBTransactionIncomplete:
                self.retry()
        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 commit(self):
     db.commitTransaction(self.txn)