btc-ag / redg

The RedG test data generation library
https://btc-ag.github.io/redg/
Apache License 2.0
10 stars 0 forks source link

Stop committing data to database #38

Closed olewehrmeyer closed 6 years ago

olewehrmeyer commented 6 years ago

The changes in this pull request will disable auto-commit when inserting RedG data with the insertDataIntoDatabase method. It will from now on be the user's responsibility to either commit the RedG data if they want to or to simply roll back the changes after the test is done. If auto-commit is enabled on the connection, it will no longer be disabled, so that the data then get committed automatically.

The insertDataIntoDatabase(DataSource dataSource) methods gets removed, as it acquires a connection from the data source and closes it after usage. Thus, if the connection is not auto-committed, the data will be immediately lost. If you were using this feature, please acquire the connection manually and manage it however you like.