Use a transaction, releases -> formations

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>