Not sure what interface you are using, but you need to shut off auto-commit and only commit explicitly when all the inserts are done.
If you are using the CLI, then the +c option shuts off auto-commit. See the Command Reference manual for details on CLI options. Don't forget to explicitly commit after you do all the inserts.