Will not use Transaction when call db/insert with a binding to *db-connection*
Nobody has claimed this yet.
- Dominant language
- Clojure
- Stars
- 576
- Forks
- 48
- PR merge metrics
- No merged PRs in 30d
Description
@camsaul
We found when call db/transaction with a binding *db-connection*, it will never work, since the
connection function will always return *db-connection*. What I suggest is to adjust the priority to move *transaction-connection* to the top. I do some testing in my local env, it works.
(defn connection []
(or *transaction-connection* ;;fix the bug move transaction to the top, otherwise transaction will not work.
*db-connection*
@default-db-connection
(throw (Exception. "DB is not set up. Make sure to call set-default-db-connection! or bind *db-connection*.")))))))
Contributor guide
No contributing guide indexed for this repository
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 at the connection function shown in the issue and trace how db/transaction and db/insert resolve a bound *db-connection*. Inspect the surrounding database connection code and any existing transaction tests, then verify that a transaction-bound connection is selected and that the normal default connection behavior still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100