UNPKG

777 BPlain TextView Raw
1// Copyright IBM Corp. 2019,2020. All Rights Reserved.
2// Node module: @loopback/repository
3// This file is licensed under the MIT License.
4// License text available at https://opensource.org/licenses/MIT
5
6/**
7 * Local transaction
8 */
9export interface Transaction {
10 /**
11 * Commit the transaction
12 */
13 commit(): Promise<void>;
14
15 /**
16 * Rollback the transaction
17 */
18 rollback(): Promise<void>;
19
20 /**
21 * Check if the transaction has an active connection
22 */
23 isActive(): boolean;
24
25 /**
26 * The transaction Identifier
27 */
28 id: string;
29}
30
31/**
32 * Isolation level
33 */
34export enum IsolationLevel {
35 READ_COMMITTED = 'READ COMMITTED', // default
36 READ_UNCOMMITTED = 'READ UNCOMMITTED',
37 SERIALIZABLE = 'SERIALIZABLE',
38 REPEATABLE_READ = 'REPEATABLE READ',
39}