To configure pessimistic concurrency control, you can do one of the following:
Enable the Select With Lock option on the Persistence/General subtab. When using jagtool or XML configuration files, set com.sybase.jaguar.component.selectWithLock to true.
Enable the Select for Update option by setting the com.sybase.jaguar.component.selectForUpdate property to true on the Advanced tab in the Component Properties dialog box or by using jagtool or an XML configuration file. This setting requests an exclusive database lock be obtained at select time to avoid deadlocks during lock promotion. Also consider configuring the database table for row-level locking.
For databases such as Sybase Adaptive Server Enterprise that do not support select for update locking syntax, EAServer locks rows by issuing a no-change update statement. The component property com.sybase.jaguar.component.touchColumn specifies which column to update. If you do not set this property, EAServer uses the first non-key column. For best performance, specify the column with the datatype that can be updated most quickly. For example, int columns can be updated more quickly than varchar columns.
Configure the table-mapping select queries and add “holdlock” or the appropriate lock syntax for your database. For more information, see “Configuring table-mapping properties” in Chapter 27, “Creating Entity Components,” in the EAServer Programmer’s Guide.
Also make sure that OCC is disabled by setting the Timestamp field to “none” on the Persistence/General subtab in the Component Properties dialog box.
Copyright © 2005. Sybase Inc. All rights reserved. |