)
Example of mirror implementation:
public void executeBulk(List bulk) throws DataSourceException {
BulkDataPersisterContext context = BulkDataPersisterContext.getCurrentContext();
if (context.isTransactional()) {
TransactionParticipantData txData = context.getTransactionData();
long id = txData.getTransactionId();
int participantId = txData.getParticipantId();
int participantsCount = txData.getParticipantsCount();
// add to pending transactions
....
// if all transactions parts arrived - execute bulk
....
}
else
{
//regular execution
....
}
}
- Since:
- 7.1
- Author:
- anna
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BulkDataPersisterContext
public BulkDataPersisterContext(TransactionParticipantData transactionData,
String sourceMemberSpaceName)
- Parameters:
transactionData
-
getCurrentContext
public static BulkDataPersisterContext getCurrentContext()
- Returns:
- the context of the current thread
setContext
public static void setContext(BulkDataPersisterContext context)
- Set the context for the current thread
resetContext
public static void resetContext()
- Resets the current context
getTransactionData
public TransactionParticipantData getTransactionData()
- Gets transaction participant data if exists.
getSourceSpaceMemberName
public String getSourceSpaceMemberName()
- Get the source space member name that sent this bulk.
isTransactional
public boolean isTransactional()
Copyright © GigaSpaces.