简体   繁体   English

数据库bean版本冲突 - (工作队列中的进程记录Guidewire

[英]Database bean version conflict -(Process records in workqueue Guidewire

I create a workqueue in BillingCenter Guidewire to process a large data, but to some records the database return a exception "Database bean version conflict :" 我在BillingCenter Guidewire中创建了一个工作队列来处理大数据,但是对于某些记录,数据库返回异常“数据库bean版本冲突:”

Someone can help me? 有人可以帮帮我吗?

How control worker to process records no process with conflict? 控制工作者如何处理记录没有冲突的进程?

Regards, Douglas Rezende 此致,Douglas Rezende

That exception occurs when entity is Versionable and two process are changing the same "record". 当实体是Versionable并且两个进程正在更改相同的“记录”时,会发生该异常。 I think that you need add a control to findTargets method of WorkQueue, maybe a new instance of your WorkQueue is running before the last execution finish. 我认为你需要为workQueue的findTargets方法添加一个控件,也许在最后一次执行完成之前你的WorkQueue的一个新实例正在运行。

private var _lock : ReentrantLock = new ReentrantLock()
private final static var _batchProcessType = BatchProcessType.TC_JOBEXPIRE

override function findTargets(): Iterator<PolicyPeriod> {
  using( _lock ) {
    var maintenanceToolsAPI = new gw.webservice.pc.pc800.MaintenanceToolsAPI()
    if (!maintenanceToolsAPI?.getWQueueStatus(_batchProcessType.Code)?.NumActiveWorkItems != 0) {
      // ...
    }
    return {}.iterator() as Iterator<PolicyPeriod>
  }
}

That way validates that don't exist one execution with active items. 这样就可以验证一次执行活动项不存在。

If you distribute the load of your work queue across the cluster and you have messages changing the same entity this will happen. 如果您在整个群集中分配工作队列的负载,并且您有消息更改同一实体,则会发生这种情况。 Guidewire 9 implements the concept of lease to get resources, you can implement a similar concept to avoid concurrency when sharing load of the work queue - keep a centralized table with records being processed (ID, Entity Type and status should be enough) and when you are finding records verify against that table that they are not being processed. Guidewire 9实现了租用的概念来获取资源,你可以实现一个类似的概念,以避免在共享工作队列的负载时的并发性 - 保持一个集中的表与正在处理的记录(ID,实体类型和状态应该足够)和当你正在查找针对该表的记录验证它们未被处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM