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

feat(core): add em.begin/commit/rollback methods #717

Merged
merged 1 commit into from
Aug 8, 2020
Merged

Commits on Aug 8, 2020

  1. feat(core): add em.begin/commit/rollback methods

    This brings back the explicit `begin/commit/rollback` way of handling
    transactions (similar to what we had in v2).
    
    ```typescript
    const em = orm.em.fork(false);
    await em.begin();
    
    try {
      //... do some work
      const user = new User(...);
      user.name = 'George';
      em.persist(user);
      await em.commit(); // will flush before making the actual commit query
    } catch (e) {
      await em.rollback();
      throw e;
    }
    ```
    B4nan committed Aug 8, 2020
    Configuration menu
    Copy the full SHA
    48e318c View commit details
    Browse the repository at this point in the history