云服务器内容精选

  • TRANSACTION DSC工具在迁移MySQL事务处理语句时会根据 GaussDB (DWS)特性进行相应适配。 输入示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ##该声明仅适用于会话中执行的下一个单个事务 SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; SET TRANSACTION ISOLATION LEVEL READ COMMITTED,READ ONLY; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE,READ WRITE; ##使用SESSION关键字,适用于当前会话中执行的所有后续事务 START TRANSACTION; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; commit ; 输出示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 --该声明仅适用于会话中执行的下一个单个事务 SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET LOCAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; SET LOCAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET LOCAL TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET LOCAL TRANSACTION READ ONLY; SET LOCAL TRANSACTION READ WRITE; SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED READ ONLY; SET LOCAL TRANSACTION ISOLATION LEVEL SERIALIZABLE READ WRITE; --使用SESSION关键字,适用于当前会话中执行的所有后续事务 START TRANSACTION; SET SESSION CHARACTERIS TICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION CHARACTERISTI CS AS TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; COMMIT WORK;
  • LOCK DSC工具在迁移MySQL事务处理锁表语句时会根据GaussDB(DWS)特性进行相应适配。 输入示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ## A. START TRANSACTION; LOCK TABLES `mt`.`runoob_tbl` WRITE,`mt`.`runoob_tb2` READ; commit; ## B. START TRANSACTION; LOCK TABLES `mt`.`runoob_tbl` WRITE; commit; ## C. START TRANSACTION; LOCK TABLES `mt`.`runoob_tbl` READ,`mt`.`runoob_tbl` AS t1 READ; commit; 输出示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 -- A. START TRANSACTION; LOCK TABLE "mt"."runoob_tbl" IN AC CES S EXCLUSIVE MODE; LOCK TABLE "mt"."runoob_tb2" IN ACCESS SHARE MODE; COMMIT WORK; -- B. START TRANSACTION; LOCK TABLE "mt"."runoob_tbl" IN ACCESS EXCLUSIVE MODE; COMMIT WORK; -- C. START TRANSACTION; LOCK TABLE "mt"."runoob_tbl" IN ACCESS SHARE MODE; COMMIT WORK;
  • 响应参数 状态码: 200 表2 响应Body参数 参数 参数类型 描述 code String 响应码 message String 响应消息 temp_info TempInfo object 事务详情 表3 TempInfo 参数 参数类型 描述 id Integer 事务ID project_id Integer 工程ID name String 事务名称 description String 事务描述 variables String 变量 contents Array of objects 事务脚本信息 temp_type Integer 事务类型(弃用) for_loop_params Array of objects 旧版本逻辑控制器字段,当前已未使用 logic_controller LogicController object 逻辑控制器信息 enable_pre Boolean 是否启用预置事务,当前版本未使用 表4 LogicController 参数 参数类型 描述 for_loop_params String 旧版本逻辑控制器字段,当前已未使用 condition String 逻辑控制器条件 状态码: 501 表5 响应Body参数 参数 参数类型 描述 - String response message
  • 响应示例 状态码: 200 success { "code" : "SVCSTG.CPTS.0000000", "message" : "success", "temp_info" : { "id" : 21531, "project_id" : 17543, "name" : "transaction", "description" : "", "variables" : null, "contents" : [ { "content_id" : 21531, "content" : [ { "content_type" : 2, "content" : { "body_type" : 0, "bodys" : [ ], "check_end_length" : null, "check_end_str" : null, "check_end_type" : null, "connect_timeout" : 5000, "connect_type" : 1, "headers" : [ { "key" : "Content-Type", "value" : "application/json" } ], "http_version" : "HTTP/1.1", "method" : "GET", "name" : "Msg-73387", "protocol_type" : 2, "return_timeout" : 5000, "return_timeout_param" : null, "url" : "https://www.domain-example.com" } } ], "index" : -1, "selected_temp_name" : "", "data" : null, "data_type" : 0, "conditions" : null, "is_disabled" : false, "is_continue" : false } ], "temp_type" : 0, "for_loop_params" : [ ], "logic_controller" : { "for_loop_params" : null, "condition" : null }, "enable_pre" : false } }
  • 请求示例 查询事务的详情信息,事务的id是1。 /v1/{project_id}/templates/1 { "code" : "SVCSTG.CPTS.0000000", "message" : "success", "temp_info" : { "id" : 155175, "project_id" : 403931, "name" : "test", "description" : "", "variables" : null, "contents" : [ { "content_id" : 155175, "content" : [ { "content_type" : 2, "content" : { "_adressValue" : "http://1.1.1.1", "body_type" : 0, "bodys" : [ ], "check_end_length" : null, "check_end_str" : null, "check_end_type" : null, "connect_timeout" : 5000, "connect_type" : 1, "headers" : [ { "key" : "Content-Type", "value" : "application/json" } ], "http_version" : "HTTP/1.1", "method" : "GET", "name" : "Msg-8015", "protocol_type" : 1, "return_timeout" : 5000, "return_timeout_param" : null, "url" : "http://1.1.1.1" } } ], "index" : -1, "selected_temp_name" : "", "data" : null, "data_type" : 0, "conditions" : null, "is_disabled" : false, "is_continue" : false } ], "temp_type" : 0, "for_loop_params" : [ ], "logic_controller" : { "for_loop_params" : null, "condition" : null }, "enable_pre" : false } }
  • TRANSACTION DSC工具在迁移MySQL事务处理语句时会根据GaussDB(DWS)特性进行相应适配。 输入示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ##该声明仅适用于会话中执行的下一个单个事务 SET TRANSACTION ISOLATION LEVEL READ COMMITTED; SET TRANSACTION ISOLATION LEVEL REPEATABLE READ; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET TRANSACTION READ ONLY; SET TRANSACTION READ WRITE; SET TRANSACTION ISOLATION LEVEL READ COMMITTED,READ ONLY; SET TRANSACTION ISOLATION LEVEL SERIALIZABLE,READ WRITE; ##使用SESSION关键字,适用于当前会话中执行的所有后续事务 START TRANSACTION; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE; commit ; 输出示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 --该声明仅适用于会话中执行的下一个单个事务 SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED; SET LOCAL TRANSACTION ISOLATION LEVEL REPEATABLE READ; SET LOCAL TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET LOCAL TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET LOCAL TRANSACTION READ ONLY; SET LOCAL TRANSACTION READ WRITE; SET LOCAL TRANSACTION ISOLATION LEVEL READ COMMITTED READ ONLY; SET LOCAL TRANSACTION ISOLATION LEVEL SERIALIZABLE READ WRITE; --使用SESSION关键字,适用于当前会话中执行的所有后续事务 START TRANSACTION; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL READ COMMITTED; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; SET SESSION CHARACTERISTICS AS TRANSACTION ISOLATION LEVEL SERIALIZABLE; COMMIT WORK; 父主题: 事务管理