# Increases values of objects in db, then stores them with the tid
# of the changes made in correct_states
defincreaseByOne(test,correct_states):
transaction.begin()
connection=test.db.open()
root=connection.root()
obj1=root['obj1']
obj2=root['obj2']
obj1._p_invalidate()
obj2._p_invalidate()
obj1.i+=randint(1,4)
obj2.i+=randint(1,4)
obj1_val=obj1.i
obj2_val=obj2.i
try:
transaction.commit()
curr_state=u64(zconn_at(connection))
ifcurr_stateincorrect_states:
connection.close()
rec_obj1=correct_states[curr_state][OBJ1_VAL]
rec_obj2=correct_states[curr_state][OBJ2_VAL]
test.fail('db state after successfull transaction is not unique. State: %d already recorded with obj1: %s, obj2: %s. This state: %d, obj1: %s, obj2: %s'