
CHAPTER 5 Implement: Making Required Application Changes
41
• Bulk copy into data-only-locked tables requires the version of
bcp and the
bulk copy libraries shipped with Adaptive Server version 11.9.2. Older
versions of
bcp and the bulk-copy libraries can still be used to copy into
allpages-locked tables. See the Release Bulletin for the required version
number.
• When using parallel sort for data-only-locked tables, the number of
worker processes must be configured to equal or exceed the number of
partitions, even for empty tables. The database option
select
into/bulkcopy/pllsort
must also be enabled.
Clustered indexes on data-only-locked tables may not return rows in clustered
key order if there is no order by clause. Bulk copy is not guaranteed to copy out
a table in clustered key order.
Queries on unpartitioned allpages-locked tables with clustered indexes return
rows in the clustered key order if the query does not include a sort (that is, if
there are no clauses such as order by or distinct). Bulk copy also copies the
rows out of allpages-locked tables in clustered key order for both partitioned
and unpartitioned tables.
Changes to Table-Level Locking
Performing an update or delete via a table scan does not acquire a table-level
exclusive lock as it did in earlier versions. In version 11.9.2, the scan acquires
an exclusive intent table lock when the transaction starts. When the scan locates
a row that must be updated, it acquires an exclusive page or row lock,
depending on the locking scheme. The only exception is an unindexed update
or delete to a data-only-locked table at transaction isolation level 3; these
updates acquire an exclusive table lock. In previous versions, any update or
delete that does not use an index acquires a table-level exclusive lock at the
start of the transaction.
In most cases, performing the scan without using a table level lock increases
concurrency. However, some applications may experience one of these
problems:
• Applications that did not deadlock in earlier versions may experience
deadlocks in 11.9.2.
• Tasks that update a large number of rows may use a large number of locks
if they cannot perform lock promotion due to conflicting locks.
Commenti su questo manuale