* @param fetchPlan the fetch plan to load fields
* @return new LifeCycle state.
**/
public LifeCycleState transitionRetrieve(StateManager sm, FetchPlan fetchPlan)
{
Transaction tx = sm.getObjectManager().getTransaction();
if (tx.isActive() && !tx.getOptimistic())
{
// Save the fields for rollback.
sm.saveFields();
sm.loadUnloadedFieldsOfClassInFetchPlan(fetchPlan);
return changeState(sm, P_CLEAN);
}
else if (tx.isActive() && tx.getOptimistic())
{
// Save the fields for rollback.
sm.saveFields(); //TODO this is wrong... saving all the time, retrieve is asked... side effects besides performance?
sm.loadUnloadedFieldsOfClassInFetchPlan(fetchPlan);
return this;