Changeset 604
- Timestamp:
- 06/02/09 11:49:28
- Files:
-
- trunk/dejavu/storage/db.py (modified) (2 diffs)
- trunk/dejavu/storage/multischema.py (modified) (2 diffs)
- trunk/dejavu/storage/storesqlite.py (modified) (1 diff)
- trunk/dejavu/units.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dejavu/storage/db.py
r600 r604 162 162 self.log(logflags.RESERVE.message(unit)) 163 163 164 def _seq_UnitSequencer Integer(self, unit):164 def _seq_UnitSequencerDynamic(self, unit): 165 165 """Reserve a unit (using the table's autoincrement fields).""" 166 166 cls = unit.__class__ … … 170 170 for k, v in newids.iteritems(): 171 171 setattr(unit, k, v) 172 _seq_UnitSequencerInteger = _seq_UnitSequencerDynamic 172 173 173 174 def _manual_reserve(self, unit): trunk/dejavu/storage/multischema.py
r561 r604 55 55 self.db.log = logger 56 56 57 def _seq_UnitSequencer Integer(self, unit):57 def _seq_UnitSequencerDynamic(self, unit): 58 58 """Reserve a unit (using the table's autoincrement fields).""" 59 59 # Grab the new ID. This is threadsafe because reserve has a mutex. … … 61 61 for k, v in newids.iteritems(): 62 62 setattr(unit, k, v) 63 _seq_UnitSequencerInteger = _seq_UnitSequencerDynamic 63 64 64 65 def _manual_reserve(self, unit): trunk/dejavu/storage/storesqlite.py
r453 r604 26 26 # uses the DB to generate the appropriate identifier(s). 27 27 seqclass = unit.sequencer.__class__.__name__ 28 if (seqclass == "UnitSequencerInteger" 29 and sqlite._autoincrement_support): 30 self._seq_UnitSequencerInteger(unit) 28 seq_handler = getattr(self, "_seq_%s" % seqclass, None) 29 if (seq_handler and 30 (seqclass != "UnitSequencerInteger" or 31 sqlite._autoincrement_support)): 32 seq_handler(unit) 31 33 else: 32 34 self._manual_reserve(unit) trunk/dejavu/units.py
r598 r604 327 327 newvalue = maxid 328 328 setattr(unit, unit.identifiers[0], newvalue) 329 330 331 class UnitSequencerDynamic(UnitSequencer): 332 """A sequencer for Unit identifiers which MUST be generated by storage.""" 333 pass 329 334 330 335
