C
cksanjose
I have an application that starts a new process every 15 minutes. I
create a new thread for each process so it is possible that they will
run concurrently. I have a data access layer that returns a
CachedRowSet object. When I only have 1 process running, the program
is fine. As soon as another process starts, I start getting errors in
the data access layer. I get an exception in
"com.sun.rowset.CachedRowSetImpl.populate".
My data access layer method looks like this:
public RowSet retrieve(String sql)
{
Connection connection = null;
ResultSet resultset = null;
CachedRowSet rowset = null;
Statement statement = null;
try
{
connection = Current.getConnection();
statement =
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
resultset = statement.executeQuery(sql);
rowset = new CachedRowSetImpl();
rowset.populate(resultset);
resultset.close();
statement.close();
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
finally
{
connection = null;
}
return rowset;
}
create a new thread for each process so it is possible that they will
run concurrently. I have a data access layer that returns a
CachedRowSet object. When I only have 1 process running, the program
is fine. As soon as another process starts, I start getting errors in
the data access layer. I get an exception in
"com.sun.rowset.CachedRowSetImpl.populate".
My data access layer method looks like this:
public RowSet retrieve(String sql)
{
Connection connection = null;
ResultSet resultset = null;
CachedRowSet rowset = null;
Statement statement = null;
try
{
connection = Current.getConnection();
statement =
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_READ_ONLY);
resultset = statement.executeQuery(sql);
rowset = new CachedRowSetImpl();
rowset.populate(resultset);
resultset.close();
statement.close();
}
catch (SQLException sqle)
{
sqle.printStackTrace();
}
finally
{
connection = null;
}
return rowset;
}