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

Rollbacks in db/transaction #67

Open
olymk2 opened this issue Oct 1, 2019 · 0 comments
Open

Rollbacks in db/transaction #67

olymk2 opened this issue Oct 1, 2019 · 0 comments

Comments

@olymk2
Copy link

olymk2 commented Oct 1, 2019

@camsaul I have been trying to use transactions with toucan, however I noticed with test my transaction are not being rolled back.

In my case i am running tests and wanting the data to not be committed and just be rolled back at the end, I am using this code.

   (db/transaction
    (jdbc/db-set-rollback-only! (db/connection))
   (db/insert! User :username "test_user" :password "test" :email "test@example.com")
    (f))

Digging into the src i noticed the rollback code was missing, is this intentional or any possibility of support rollback when things fail, I am not sure of the implications of just dropping in the rollback expression into the db/transact wrapper.

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