When an item type’s cache-mode is set to locked, the Oracle Commerce Platform uses read and write locks to control which threads can access and change items of that type. The exact behavior depends on how you set the isolation level for the item descriptor.

To minimize deadlocks when you use locked caching, configure item descriptors to use one of the following repository isolation levels:

Isolation Level

Description

readCommitted (default)

The system obtains a read lock on an item when a transaction calls getItem or getPropertyValue. If the transaction tries to update the item, the system releases the read lock and tries to acquire a write lock.

repeatableRead

The system obtains a read lock on an item when a transaction first calls getItem or getPropertyValue. If the transaction tries to update the item, the system tries to convert the read lock into a write lock.

Unlike readCommitted, the repeatableRead isolation level prevents another transaction from obtaining a write lock on the item.

serializable

Prevents different transactions from reading an item at the same time, whether from the same server, or from different servers.

You set an item type’s isolation level in its <item-descriptor> tag as in the following example:

<item-descriptor name="myItem" cache-mode="locked">
    <attribute name="isolationLevel" value="readCommitted"/>
...
</item-descriptor>

Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices