Skip to content

Removing separate connection for bulkcopy #880

Open

Description

@benmatwil

Hey benmatwil, thanks for reporting this in detail.
You're right, this is a bug.

The __exit__ implementation today just calls close(), which always rolls back uncommitted changes when autocommit=False.
There's no commit path in the context manager at all, so clean exits and exception exits both end up rolling back.

The wiki and the docstrings all describe commit-on-success / rollback-on-exception. , and that's what the implementation should be doing.
We'll fix __exit__ to match.

On bulkcopy and connections: Yes, bulkcopy() opens a separate internal PyCoreConnection under the hood.
This is a known limitation of the design and has been discussed across & tracked in #492.

Originally posted by Gaurav Sharma (@bewithgaurav) in #635

Hi, to follow up from this from June. Are there any timelines/plans to merge the connections of the api?

Activity

  1. github-actions commented on Nov 2, 2026

    @github-actions

    Hi benmatwil, thank you for opening this issue!

    Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.

    If you have additional information to share, please feel free to update the issue.

    Thank you for your patience!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triage neededFor new issues, not triaged yet.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions