com.endeca.portal.mdex
Class TransactionUtil

java.lang.Object
  extended by com.endeca.portal.mdex.TransactionUtil

public class TransactionUtil
extends java.lang.Object

This class calls outer transaction web services to provide transaction supports to EID Studio. With transaction services, the caller can start, commit or rollback a transaction, which may consist of multiple "write" operations. Using of transaction will help with keeping data consistency in certain circumstances. This class is called/wrapped by the DataSource class. The user should use DataSource class instead of TransactionUtil class for transaction management. A typical usage pattern is as follows (pseudo-codes): String outerTransactionId=null; try{ outerTransactionId=DataSource#startOuterTransaction(); //call write operations that supports transaction management, e.g. deleteAllFilterRules, putFilterRules. ... //commit the transaction DataSource#commitOuterTransaction(outerTransactionId); }catch(Exception e){ //in case that an exception occurs, rollback the transaction (if the transaction has been started). //Note: Do NOT rollback transaction that has not yet been started. if(outerTransactionId!=null) DataSource#rollBackOuterTransaction(outerTransactionId); Logger#error("... Error message: "+e.getMessage()); throw e; }

Author:
walterwu

Nested Class Summary
static class TransactionUtil.CommitOuterTransactionOperation
           
static class TransactionUtil.ListOuterTransactionOperation
           
static class TransactionUtil.RollBackOuterTransactionOperation
           
static class TransactionUtil.StartOuterTransactionOperation
           
 
Field Summary
static java.lang.String TRANSACTION_SERVICE
           
 
Constructor Summary
TransactionUtil()
           
 
Method Summary
static
<OperationType,ResponseType>
ResponseType
executeTransactionOperation(MDEXState mdexState, RequestIds requestIds, com.endeca.portal.mdex.TransactionUtil.TransactionOperation<ResponseType> op, java.lang.String languageId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSACTION_SERVICE

public static final java.lang.String TRANSACTION_SERVICE
See Also:
Constant Field Values
Constructor Detail

TransactionUtil

public TransactionUtil()
Method Detail

executeTransactionOperation

public static <OperationType,ResponseType> ResponseType executeTransactionOperation(MDEXState mdexState,
                                                                                    RequestIds requestIds,
                                                                                    com.endeca.portal.mdex.TransactionUtil.TransactionOperation<ResponseType> op,
                                                                                    java.lang.String languageId)
                                                throws DataSourceException,
                                                       java.lang.UnsupportedOperationException
Throws:
DataSourceException
java.lang.UnsupportedOperationException