Hi All,
I am using an autoactivity in which the method at the backend hits the database and fires queries at it.I am using IDfQuery and IDfCOllection objects for this .I am using the normal procedure where we create an IDfquery object,a session and then a collection to get the results.
IDfQuery tQuery = new DfQuery();
private static IDfCollection tempColl_3 = null;
tQuery.setDQL(tData);
tempColl_3 = tQuery.execute(SESSION, DfQuery.DF_READ_QUERY);
try{
while (tempColl_3.next())
{
userName = tempColl_3.getString("user_name");
if ((usersEmail == null) || (usersEmail.equals("")))
{
usersEmail = tempColl_3.getString("user_address");
}
else
{
usersEmail +=";" + tempColl_3.getString("user_address");
}
}
//note: userName and usersEmail are variables which I have declared properly.
}
catch(Exception ee)
{
ee.printStackTrace();
}
finally{
if (tempColl_3 != null)
{
tempColl_3.close();
tempColl_3 = null;
}
}
IMP NOTE: It does not matter whether I set the tempColl_3 = null as I did in the finally block.The Nullpointer exception keeps on coming even if I remove it.
Is it something related to the database session or database connectivity.Is the connection getting timed out?There are many colections like this in my code but all have been handled properly. Kindly advise me as to why I am getting this error?
Do I need to make any config changes so that a session that I am using to fire the queries lasts longer.