state transition db save