添加达梦、MySQL 数据库适配功能
这个提交包含在:
+11
-2
@@ -19,6 +19,9 @@ import java.util.function.Supplier;
|
||||
/** The operation row commits independently of the consuming business transaction. */
|
||||
@Repository
|
||||
public class PrivateBusinessFileJdbcRepository {
|
||||
@org.springframework.beans.factory.annotation.Autowired
|
||||
private cn.aixunkeji.common.core.enums.PlatformDatabaseDialect databaseDialect = cn.aixunkeji.common.core.enums.PlatformDatabaseDialect.DAMENG;
|
||||
|
||||
static final String PRIVATE_SERVICE = "datagov-local-pvt";
|
||||
private final JdbcTemplate jdbc;
|
||||
private final TransactionTemplate transactions;
|
||||
@@ -47,13 +50,19 @@ public class PrivateBusinessFileJdbcRepository {
|
||||
Stored reserve(StageRequest request, String descriptorSha, String storageKey) {
|
||||
Context c = request.context();
|
||||
// The unique operation scope excludes Actor: a different currently authorized reviewer can recover.
|
||||
jdbc.update("""
|
||||
jdbc.update(databaseDialect.sql("""
|
||||
INSERT /*+ IGNORE_ROW_ON_DUPKEY_INDEX(sys_oss_business_binding) */ INTO sys_oss_business_binding
|
||||
(organization_id,department_id,operation_key,descriptor_sha256,payload_sha256,oss_id,
|
||||
storage_key,target_json,state,next_offset,producer_actor,created_at,updated_at,row_version)
|
||||
VALUES (?,?,?,?,?,?,?,?,'PREPARING',0,?,CURRENT_TIMESTAMP(6),CURRENT_TIMESTAMP(6),0)
|
||||
|
||||
""", c.organizationId(), c.departmentId(), request.operationKey(), descriptorSha,
|
||||
""", """
|
||||
INSERT IGNORE INTO sys_oss_business_binding
|
||||
(organization_id,department_id,operation_key,descriptor_sha256,payload_sha256,oss_id,
|
||||
storage_key,target_json,state,next_offset,producer_actor,created_at,updated_at,row_version)
|
||||
VALUES (?,?,?,?,?,?,?,?,'PREPARING',0,?,CURRENT_TIMESTAMP(6),CURRENT_TIMESTAMP(6),0)
|
||||
|
||||
"""), c.organizationId(), c.departmentId(), request.operationKey(), descriptorSha,
|
||||
request.payloadSha256(), IdGeneratorUtil.nextLongId(), storageKey,
|
||||
JsonUtils.toJsonString(request.target()), c.actorId());
|
||||
Stored stored = find(new WriteQuery(c, request.operationKey()));
|
||||
|
||||
在新工单中引用
屏蔽一个用户