yesodweb / yesodweb/persistent

weird behaviour of runSqlPoolNoTransaction on persistent-mysql

Open
#1,453 2 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.