Hi,

I notice that afterPhase method in the PhaseListener included in this email is exceuted before the Rendering is completed. During rendering the JSF view acceces the model which in turn accecces the database. In order to access the database a new DB session is created, thus defeating the purpose of having a DBUtil.closeSession() in the afterPhase method.

Is this correct behaviour? Is it likely that something is wrong with my configuration?


-Umesh
(Code attached below)

-----------------------------------x-------------------------

package com.ebay.channel.phaselisteners;

import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;

import com.ebay.db.DbUtil;

public class SessionClosePhaseListener implements PhaseListener {

        public void beforePhase(PhaseEvent event) {

        }

        public void afterPhase(PhaseEvent event) {

                DbUtil.closeSession();
        }

        public PhaseId getPhaseId() {

                return PhaseId.RENDER_RESPONSE;
        }

}


Reply via email to