transactional

Spring Data Transactional Nodejs implementation

View the Project on GitHub muyu66/transactional

@Transactional

Build Status: Linux Coverage Status TypeScript Chat MIT Licence

Translations: 简体中文

@Transactional is a package created to solve the problem of transaction delivery in nodejs code can only rely on parameter passing between functions. Now, we use the decorator (annotation) to pass.

Use immediately:

import { Transactional } from 'transactionaljs'

class UserService {
	@Transactional()
	public async createUser(){}
}

Immediate test:

npm install
npm run test

Features:

 

Roadmap:

 

Type definition

Type Description
REQUIRED Supports the current transaction if there is a transaction. Turn on if there is no transaction
SUPPORTS Supports the current transaction if there is a transaction. Non-transactional execution if there is no transaction
REQUIRES_NEW Always open a new transaction. Suspend this existing transaction if a transaction already exists
NOT_SUPPORTED Always execute non-transactionally and suspend any existing transactions
NEVER is always executed non-transactionally, throwing an exception if there is an active transaction