8000 "query" relationLoadStrategy is buggy within transactions · Issue #9988 · typeorm/typeorm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
"query" relationLoadStrategy is buggy within transactions #9988
Closed
@riqwan

Description

@riqwan

Issue description

When you are create records related to each other within a transaction, the created relations of the created records are not queryable. The query seems to be happening outside of the transaction.

Expected Behavior

When queries are made on on to many relations of a record, the queries should be done within the same transaction. Re-use the same query planner

Actual Behavior

Queries happen outside of the transaction, a new query planner handles that.

Steps to reproduce

  • Within a transaction
    • Create Article and N comments using Article repository
    • Save Article
    • Retrieve Article via findOne with comments as relations.
    • Expect article.comments to be eq ([])

My Environment

Dependency Version
Operating System
Node.js version 17
Typescript version x.y.zzz
TypeORM version 0.3.14

Additional Context

No response

Relevant Database Driver(s)

  • aurora-mysql
  • aurora-postgres
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • spanner
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, and I know how to start.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0