return object;
}
// a transaction must already be active (autocommit is not supported)
assertActive();
final DomainTypeHandler<?> domainTypeHandler = getDomainTypeHandler(object);
final ValueHandler instanceHandler = domainTypeHandler.getValueHandler(object);
setPartitionKey(domainTypeHandler, instanceHandler);
Table storeTable = domainTypeHandler.getStoreTable();
// perform a primary key operation
final Operation op = clusterTransaction.getSelectOperation(storeTable);
// set the keys into the operation
domainTypeHandler.operationSetKeys(instanceHandler, op);
// set the expected columns into the operation
domainTypeHandler.operationGetValues(op);
final ResultData rs = op.resultData(false);
final SessionImpl cacheManager = this;
// defer execution of the key operation until the next find, flush, or query
Runnable postExecuteOperation = new Runnable() {
public void run() {
if (rs.next()) {
// found row in database
instanceHandler.found(Boolean.TRUE);
// put the results into the instance
domainTypeHandler.objectSetValues(rs, instanceHandler);
// set the cache manager to track updates
domainTypeHandler.objectSetCacheManager(cacheManager, instanceHandler);
// reset modified bits in instance
domainTypeHandler.objectResetModified(instanceHandler);
} else {
// mark instance as not found
instanceHandler.found(Boolean.FALSE);
}
}
};
postExecuteOperations.add(postExecuteOperation);