yesodweb / yesodweb/persistent
weird behaviour of runSqlPoolNoTransaction on persistent-mysql
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 486
- Forks
- 306
- PR merge metrics
- No merged PRs in 30d
Description
Currently autocommit is disabled here: https://github.com/yesodweb/persistent/blob/b8484fa8327358f5770d52f6243b9cc5c0861122/persistent-mysql/Database/Persist/MySQL.hs#L135
This means that runSqlPoolNoTransaction does not do what most users would expect; instead it leaves uncommitted changes. Is this intended? My understanding is that there is no need to disable autocommit because START TRANSACTION is called explicitly here
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with persistent-mysql/Database/Persist/MySQL.hs around the autocommit setup near line 135, then inspect the START TRANSACTION call referenced in the issue. Reproduce runSqlPoolNoTransaction with a change and verify whether it remains uncommitted; done means its behavior matches the expected transaction semantics and the relevant tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell, mysql
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100