public Operation insert(
DomainTypeHandler<?> domainTypeHandler, ValueHandler valueHandler) {
startAutoTransaction();
setPartitionKey(domainTypeHandler, valueHandler);
Operation op = null;
Table storeTable = null;
try {
storeTable = domainTypeHandler.getStoreTable();
op = clusterTransaction.getInsertOperation(storeTable);
// set all values in the operation, keys first
domainTypeHandler.operationSetKeys(valueHandler, op);
domainTypeHandler.operationSetModifiedNonPKValues(valueHandler, op);
// reset modified bits in instance
domainTypeHandler.objectResetModified(valueHandler);
} catch (ClusterJUserException cjuex) {
failAutoTransaction();
throw cjuex;
} catch (ClusterJException cjex) {
failAutoTransaction();
logger.error(local.message("ERR_Insert", storeTable.getName()));
throw new ClusterJException(
local.message("ERR_Insert", storeTable.getName()), cjex);
} catch (RuntimeException rtex) {
failAutoTransaction();
logger.error(local.message("ERR_Insert", storeTable.getName()));
throw new ClusterJException(
local.message("ERR_Insert", storeTable.getName()), rtex);
}
endAutoTransaction();
return op;
}