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

[Feature Request] Implement @Transactional() decorator on class level #5

Open
Aliheym opened this issue Aug 22, 2022 · 1 comment
Open
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Aliheym
Copy link
Owner

Aliheym commented Aug 22, 2022

Description

Allow using @Transactional() decorator with the entire class (apply to all methods). This decorator needs to have the same interface as the existing one. We also need a possibility to ignore some class methods (something like another decorator or additional option).

@Transactional({ propagation: Propagation.REQUIRES_NEW })
class PostsService {
  constructor() {
    // ...
  }
  
  // If we need to ignore we can use a new decorator @NonTransactional() 
  // or using new option @Transactional({ ignore: true }) (?) think about it
  async getPostById() {
     // ...
   }
  
  // If we use explicit`@Transactional()  then we need to override options that were defined in class-level `@Transactional`
  @Transactional({  propagation: Propagation.NESTED })
  async updatePost() {
     // ...
   }
}

Of course, we need tests and documentation for these new features.

@Aliheym Aliheym added enhancement New feature or request good first issue Good for newcomers labels Aug 22, 2022
@vvtri
Copy link

vvtri commented Jun 9, 2023

Hi @Aliheym, when this ready to be used ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants