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 Model #31

Open
yisraelU opened this issue Feb 18, 2022 · 1 comment
Open

Transaction Model #31

yisraelU opened this issue Feb 18, 2022 · 1 comment

Comments

@yisraelU
Copy link
Contributor

yisraelU commented Feb 18, 2022

We should probably have a model for Sql Transactions ,plus isolation levels

  • set isolation level
  • run multiple statements in one transaction
  • Rollback feature
@LA-94
Copy link

LA-94 commented Oct 4, 2024

Good day!

Please tell me when the completion of the "run multiple statements in one transaction" task is planned?

I have not found a way to disable the auto commit of a transaction so that the ZConnectionPool.transaction method rolls back several statements.

As I understand it, some kind of option is needed to disable autocommit in the ZConnectionPoll.make method so that the ZIO.unless(autocommitMode)(connection.rollback.ignoreLogged) line worked

There is no way to disable autocommit in the external Postgresql database properties

For example, the transaction will not roll back here and the first expression will remain committed:

transaction {
    for {
       _ <- SqlFragment(...).execute
       _ <- SqlFragment(...).execute.zipRight(ZIO.fail(new RuntimeException("SOME PROBLEM"))
    } yield()
}

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

2 participants