Here's some more information:
I load the database using a loader that has a sql statements to load the category and questions table using the ij tool.
If I go to the cloudscape prompt and do a select * from questions table.
ij> select * from questions;
1016 |What is question3?
|MULTIPLE
1017 |What is question4?
|SINGLE
1018 |What is question5?
|SINGLE
I get the output above, which is what I loaded into the database.
But after issuing a hibernate query, it has the effect of removing/deleting all the above entries and returning a zero item list.
PracticeManager pracMgr = new PracticeManager();
List questions = pracMgr.listQuestions();
int size = questions.size()
But now if I programmatically add.
PracticeManager pracMgr = new PracticeManager();
createAndStoreCategory(2007,"NewCategory");
createAndStoreQuestions("desc1","type1");
createAndStoreQuestions("desc2","type2");
createAndStoreQuestions("desc3","type3");
List questions = pracMgr.listQuestions();
int size = questions.size();
the query works, but only once. If I start the program again, the hibernate query process has removed all the entries from the table.
Anybody know why this happens?
|