0

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 :"

Someone can help me?

How control worker to process records no process with conflict?

Regards, Douglas Rezende

2 Answers2

1

That exception occurs when entity is Versionable and two process are changing the same "record". 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.

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.

Carlos Duque
  • 482
  • 3
  • 7
0

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.

jramos
  • 108
  • 1
  • 8