Este conteúdo não está disponível no idioma selecionado.

10.3. Lock Management and Concurrency Control


Concurrency control information within JBoss Transaction Service is maintained by locks. Some of these locks need to be used by multiple objects in different processes. They can be held in a lock store, similar to the object store used for state information. The lock store used with JBoss Transaction Service has a restricted interface which allows flexibility with regard to implementation. Lock stores can be implemented in shared memory, on the Unix file system in several different formats, or as a remotely accessible store.

Note

As with all JBoss Transaction Service classes, the default lock stores are pure Java implementations. If you want to use more complex lock implementations, you must use native methods.

Example 10.8. Example LockStore Class

public class LockStore
{
    public abstract InputObjectState read_state (Uid u, String tName)
	throws LockStoreException;
    
    public abstract boolean remove_state (Uid u, String tname);
    public abstract boolean write_committed (Uid u, String tName,
					     OutputObjectState state);
};
Copy to Clipboard Toggle word wrap

10.3.1. Selecting a Lock Store Implementation

JBoss Transaction Service supports several different object store implementations. If the object model being used is Single, no lock store is required for maintaining locks, because the information about the object is not exported from it. However, if you use the Multiple model, different run-time environments may need to share concurrency control information. You can specify the implementation type of the lock store to use for all objects within a given execution environment using the com.arjuna.ats.txoj.lockstore.lockStoreType property. This variable can be either:
BasicLockStore
This is an in-memory implementation which does not include support for sharing of stored information between execution environments. You can extend it to include this functionality, if needed.
BasicPersistentLockStore
This is the default implementation. It stores locking information within the local file system. Execution environments that share the same file store can share concurrency control information. The root of the file system into which locking information is written is the LockStore/ directory within the JBoss Transaction Service installation directory. To override this location, set the com.arjuna.ats.txoj.lockstore.lockStoreDir property accordingly, or include the location in the CLASSPATH:

How to Override the lockStoreDir Property

  • java -D com.arjuna.ats.txoj.lockstore.lockStoreDir=/var/tmp/LockStore myprogram
  • java –classpath $CLASSPATH;/var/tmp/LockStore myprogram
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat