Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction needs to be reset after duplicate #16

Open
mthaak opened this issue May 1, 2020 · 0 comments
Open

Transaction needs to be reset after duplicate #16

mthaak opened this issue May 1, 2020 · 0 comments

Comments

@mthaak
Copy link

mthaak commented May 1, 2020

While using this script to fill our Postgresql database, I discovered that whenever duplicates are detected in data_loader.py (line 336), the transaction is not always reset.

So this exception is raised for the next INSERT INTO command:

sqlalchemy.exc.InternalError: (InFailedSqlTransaction) current transaction is aborted, commands ignored until end of transaction block

To solve this I added the following code on line 341:

# Reset transaction
transaction.commit()
transaction = sql_alc_conn.begin()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant