Re: [sqlalchemy] Bulk Insert Exception Handling

2020-11-23 Thread hara chaitanya
Thanks Mike for your response. I will try using DBAPI to achieve batching. Thanks, Hara. On Monday, November 23, 2020 at 12:15:44 PM UTC-5 Mike Bayer wrote: > the bulk_save_objects() method will use executemany() if possible but this > has no impact on the behavior of a failing row. cx_Oracle

Re: [sqlalchemy] Bulk Insert Exception Handling

2020-11-23 Thread Mike Bayer
the bulk_save_objects() method will use executemany() if possible but this has no impact on the behavior of a failing row. cx_Oracle wil normally run all the parameter sets inside of executemany() inside of a single transaction and if any parameter set fails, the operation stops. if you'd

[sqlalchemy] Bulk Insert Exception Handling

2020-11-23 Thread hara chaitanya
Hello All, I am new to using SQLAlchemy. I am trying to insert records into Oracle table using "session.bulk_save_objects()" method. However it seems if one insert statement fails it would rollback complete transaction. Cx_oracle library helps achieve this by executemany method with batching

Re: [sqlalchemy] object “is already present in this session” when using a new session with older objects

2020-11-23 Thread Simon King
I think your situation is described here: https://docs.sqlalchemy.org/en/14/orm/session_state_management.html#merge-tips I'm not certain, but my guess is that when you create westGate, you cause a *copy* of typeDict['gate'] to be merged into the current session (because the merge cascades across