Skip to content

Conversation

@dcherian
Copy link
Contributor

Repository only knows about Sessions, so Repository.transaction should yield a Session.

I am raising a DeprecationWarning, though we could instead make a breaking change.

@dcherian dcherian requested review from paraseba and rabernat July 17, 2025 15:14
@paraseba
Copy link
Collaborator

I'm not sure what's best. This is an important method, so we would break a lot of code. Maybe we just live with it and find a new name for the Session yielding transaction?

@rabernat
Copy link
Contributor

Repository only knows about Sessions, so Repository.transaction should yield a Session.

I'm not sure I agree with this. If we switch to yielding a session, what happens if you commit the session inside the transaction? To me this indicates that transaction needs to yield something other than a session.

@paraseba
Copy link
Collaborator

We could play some tricks to not allow you to commit explicitly, or to detect that you did and do nothing on block exit

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

Successfully merging this pull request may close these issues.

4 participants