Use of transaction managers
Hi,
I am wondering how many transaction managers I should create and where they should live. I want to create transaction managers in the location where the network traffic between the client, the space partitions and the transaction manager is kept to a minimum.
Given the following requirements:
- components in processing units have to transactionally modify their partitions
- components in processing units have to transactionally modify their spaces
- external clients have to transactionally modify spaces
Below, p is the number of partitions and c is the number of external clients.
PU component transactionally modifying partition
The first requirement is easy to implement, so I have no questions about it (p partition tx managers per space):
<os-core:space id="space" url="/./space" />
<os-core:local-tx-manager id="transactionManager" space="space" />
<os-core:giga-space id="gigaSpace" space="space" tx-manager="transactionManager" />
PU component transactionally modifying space
For the second requirement do I:
- create a transaction manager in each processing unit (p cluster tx managers per space):
<os-core:space id="space" url="/./space" />
<os-core:distributed-tx-manager id="clusterTransactionManager" />
<os-core:giga-space id="clusterGigaSpace" space="space" tx-manager="clusterTransactionManager" clustered="true" />
- create a separate transaction manager and look it up in each processing unit (1 cluster tx manager per space):
<os-core:space id="space" url="/./space" />
<os-core:jini-tx-manager id="clusterTransactionManager" lookup-timeout="5000" />
<os-core:giga-space id="clusterGigaSpace" space="space" tx-manager="clusterTransactionManager" clustered="true" />
If the second case is better:
- where and how do I start a separate transaction manager?
- how to start a separate transaction manager for each space to prevent transactions from spanning multiple spaces?
- how to prevent a separate transaction manager from becoming a single point of failure?
External client transactionally modifying space
For the third requirement do I:
- create a transaction manager in each processing unit (p cluster tx managers per space) and get a reference to one of these (or a failover proxy) in the client:
<os-core:space id="space" url="/./space" />
<os-core:distributed-tx-manager id="clusterTransactionManager" />
<os-core:giga-space id="clusterGigaSpace" space="space" tx-manager="clusterTransactionManager" clustered="true" />
PlatformTransactionManager ptm = ?;
GigaSpace gs = new GigaSpaceConfigurer(s).transactionManager(ptm).gigaSpace();
- create a transaction manager in each client (c cluster tx managers per space):
PlatformTransactionManager ptm = new DistributedJiniTxManagerConfigurer().transactionManager();
GigaSpace gs = new GigaSpaceConfigurer(s).transactionManager(ptm).gigaSpace();
- create a separate transaction manager and look it up in each client (1 cluster tx manager per space):
PlatformTransactionManager ptm = ?;
GigaSpace gs = new GigaSpaceConfigurer(s).transactionManager(ptm).gigaSpace();
For the first case:
- how to lookup one of the transaction managers in the processing units (or a failover proxy)?
The questions for the third case are the same as the questions for the second case of the previous section.
Thanks in advance for your help.
Regards,
Johan Stuyts
This thread was imported from the previous forum.
For your reference, the original is available here