Article Details
Id:12100
Product:finPOWER Connect
Type:NEW
Version:2.02.00
Opened:31/07/2014
Closed:31/07/2014
Released:29/09/2014
Job: J013718
Breaking Change

Transaction Batches; new option to make locking optional

A new option has been added to Transaction Batches to make locking optional. This applies to both Transaction and Bank Transaction batches.

When a Batch is loaded or saved for the first time and locking is used, a lock is placed on the Batch. This works fine within the finPOWER Connect User Interface, and locks are still used.

However, when a lock is acquired or released, it must be done outside a database Transaction. This may cause issues when using Batches via the finPOWER Connect Business Layer.

Creating a Batch in the finPOWER Connect Business Layer will now default to NOT using locking. This allows the most flexibility. To use Locking, you must pass True into the finBL.CreateBatch or finBL.CreateBankBatch functions - see the examples below.

Notes:

  • Locking is really only there to stop two users editing the same batch in the User Interface.
  • Locks are only used if you have defined a BatchId. Generally, when using the Business Layer, unless you need to save a Batch for later edit, you should never set a BatchId and therefore locking would never be used - regardless of this option.
  • If you are using Batch.Lock or Batch.Unlock directly in code accessing the Business Layer you will need to make sure you create the Batch using locking - otherwise an error will occur.
  • Database timestamps handle database concurrency in the Business Layer, i.e. preventing multiple Users overwriting each other's changes.
' To create a Batch without Locking (the default)
Batch = finBL.CreateBatch()
Batch = finBL.CreateBatch(False)

' To create a Batch using Locking
Batch = finBL.CreateBatch(True)