Old Data kept and displayed at times
tazz786 Dec 21, 2009 11:22 AMHi
We have an application which basically has a datatable (containing questions) that is populated from a volist (arraylist). There is some strange behaviour happening intermittently. if you add a question to that arraylist, through the application, there are times, when the volist no longer belongs to that entity with which we are dealing with. I brings data from previous sessions.
For example, I went to edit survey a . The I saved and went to survey b. While adding questions to survey b, sometimes, the datatable now shows questions from survey a.
I have attached a piece of code that is the getter for the volist...
public ArrayList<QuestionVO> getQuestionVoList() {
logger.info("getQuestionVoList():START");
try {
if(questionVoList != null && !questionVoList.isEmpty()) {
setShowQuestionVODatatable(true);
} else {
loadQuestionVOList();
if(questionVoList == null)
questionVoList = new ArrayList<QuestionVO>();
setShowQuestionVODatatable(false);
}
logger.info("getQuestionVoList():END");
} catch (Exception
e) {
.
......
}
return questionVoList;
}
private void loadQuestionVOList() {
try {
if(userSession.getSelectedSurveyEntity() != null && (userSession.getSelectedSurveyEntity().getStatus().getStatusId().intValue() == 1 ||
userSession.getSelectedSurveyEntity().getStatus().getStatusId().intValue() == 4)) {
setQuestionVoList(surveyActionHelper.buildQuestionVOReassign(userSession
.getSelectedSurveyEntity().getSurveyId()));
} else {
//load with the already assigned nextQuestionItemId
setQuestionVoList(surveyActionHelper.buildQuestionVO(userSession
.getSelectedSurveyEntity().getSurveyId()));
}......
Also, once you notice the questions are from another survey, then if you press CTRL F5, then the correct questions are loaded...
Any ideas someone please...
We have an application which basically has a datatable (containing questions) that is populated from a volist (arraylist). There is some strange behaviour happening intermittently. if you add a question to that arraylist, through the application, there are times, when the volist no longer belongs to that entity with which we are dealing with. I brings data from previous sessions.
For example, I went to edit survey a . The I saved and went to survey b. While adding questions to survey b, sometimes, the datatable now shows questions from survey a.
I have attached a piece of code that is the getter for the volist...
public ArrayList<QuestionVO> getQuestionVoList() {
logger.info("getQuestionVoList():START");
try {
if(questionVoList != null && !questionVoList.isEmpty()) {
setShowQuestionVODatatable(true);
} else {
loadQuestionVOList();
if(questionVoList == null)
questionVoList = new ArrayList<QuestionVO>();
setShowQuestionVODatatable(false);
}
logger.info("getQuestionVoList():END");
} catch (Exception
e) {
.
......
}
return questionVoList;
}
private void loadQuestionVOList() {
try {
if(userSession.getSelectedSurveyEntity() != null && (userSession.getSelectedSurveyEntity().getStatus().getStatusId().intValue() == 1 ||
userSession.getSelectedSurveyEntity().getStatus().getStatusId().intValue() == 4)) {
setQuestionVoList(surveyActionHelper.buildQuestionVOReassign(userSession
.getSelectedSurveyEntity().getSurveyId()));
} else {
//load with the already assigned nextQuestionItemId
setQuestionVoList(surveyActionHelper.buildQuestionVO(userSession
.getSelectedSurveyEntity().getSurveyId()));
}......
Also, once you notice the questions are from another survey, then if you press CTRL F5, then the correct questions are loaded...
Any ideas someone please...