private Object activateInstance(Object primaryKey, ThreadContext callContext) throws SystemException, ApplicationException {
// attempt to active a passivated entity
BeanEntry entry = activate(primaryKey);
if (entry == null) {
throw new InvalidateReferenceException(new NoSuchObjectException("Not Found"));
}
if (entry.isTimedOut()) {
// Since the bean instance hasn't had its ejbActivate() method called yet,
// it is still considered to be passivated at this point. Instances that timeout
// while passivated must be evicted WITHOUT having their ejbRemove()
// method invoked. Section 6.6 of EJB 1.1 specification.
throw new InvalidateReferenceException(new NoSuchObjectException("Timed Out"));
}
// call the activate method
Operation currentOperation = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.ACTIVATE);