Esempio n. 1
0
 def __init__(self, name, aggregate_class=None,
              join_transaction=True, autocommit=False):
     MemoryRepository.__init__(self, name,
                               aggregate_class=aggregate_class,
                               join_transaction=join_transaction,
                               autocommit=autocommit)
     self.configure(directory=os.getcwd(), content_type=CsvMime,
                    cache_loader=self.__load_entities)
Esempio n. 2
0
 def commit(self, unit_of_work):
     """
     Dump all resources that were modified by the given session back into
     the repository.
     """
     MemoryRepository.commit(self, unit_of_work)
     if self.is_initialized:
         entity_classes_to_dump = set()
         for state in unit_of_work.iterator():
             entity_classes_to_dump.add(type(state.entity))
         for entity_cls in entity_classes_to_dump:
             self.__dump_entities(entity_cls)