Use a transaction when creating an artifact.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
Merge pull request #29 from archSeer/artifact-transaction

Use a transaction when creating an artifact.