CUBRID Engine  latest
dbtran_def.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 /*
20  * Transaction isolation definitions
21  */
22 
23 #ifndef _DBTRAN_DEF_H_
24 #define _DBTRAN_DEF_H_
25 
26 typedef enum
27 {
28  TRAN_UNKNOWN_ISOLATION = 0x00, /* 0 0000 */
29 
30  TRAN_READ_COMMITTED = 0x04, /* 0 0100 */
31  TRAN_REP_CLASS_COMMIT_INSTANCE = 0x04, /* Alias of above */
32  TRAN_CURSOR_STABILITY = 0x04, /* Alias of above */
33 
34  TRAN_REPEATABLE_READ = 0x05, /* 0 0101 */
35  TRAN_REP_READ = 0x05, /* Alias of above */
36  TRAN_REP_CLASS_REP_INSTANCE = 0x05, /* Alias of above */
37  TRAN_DEGREE_2_9999_CONSISTENCY = 0x05, /* Alias of above */
38 
39  TRAN_SERIALIZABLE = 0x06, /* 0 0110 */
40  TRAN_DEGREE_3_CONSISTENCY = 0x06, /* Alias of above */
41  TRAN_NO_PHANTOM_READ = 0x06, /* Alias of above */
42 
45 
46  TRAN_MINVALUE_ISOLATION = 0x04, /* internal use only */
47  TRAN_MAXVALUE_ISOLATION = 0x06, /* internal use only */
48 
49  // aliases for CCI compatibility
53 
54 #define IS_VALID_ISOLATION_LEVEL(isolation_level) \
55  (TRAN_MINVALUE_ISOLATION <= (isolation_level) \
56  && (isolation_level) <= TRAN_MAXVALUE_ISOLATION)
57 
58 #define TRAN_DEFAULT_ISOLATION_LEVEL() (TRAN_DEFAULT_ISOLATION)
59 
60 #define TRAN_ASYNC_WS_BIT 0x10 /* 1 0000 */
61 #define TRAN_ISO_LVL_BITS 0x0F /* 0 1111 */
62 
63 #endif // _DBTRAN_DEF_H_
DB_TRAN_ISOLATION
Definition: dbtran_def.h:26