use transactions for faster import

Change-Id: Ibd6dd2e318c2b18bb60e10b845076ee33d2dbc04