K
knightowl
I may be using the createStatement function incorrectly, however I have
a function that does the following:
I run the following routine 200,000 times and there is a memory leak
that therein. I take the createStatement() out of there and no memory
leak.
---------------------------------------------------------
try
{
s = connection.createStatement();
connection.setAutoCommit(false);
s.executeUpdate("LOCK TABLES counters WRITE;");
s.executeUpdate("UNLOCK TABLES;");
}
catch (SQLException e)
{
System.out.println(e);
try
{
connection.rollback();
}
catch (SQLException ex)
{
System.out.println("THere was a probem rolling back the
transaciton");
ex.printStackTrace();
}
}
finally
{
p.idleConnection(connection);
pm = null;
connection = null;
rs = null;
update = null;
select = null;
p = null;
}
a function that does the following:
I run the following routine 200,000 times and there is a memory leak
that therein. I take the createStatement() out of there and no memory
leak.
---------------------------------------------------------
try
{
s = connection.createStatement();
connection.setAutoCommit(false);
s.executeUpdate("LOCK TABLES counters WRITE;");
s.executeUpdate("UNLOCK TABLES;");
}
catch (SQLException e)
{
System.out.println(e);
try
{
connection.rollback();
}
catch (SQLException ex)
{
System.out.println("THere was a probem rolling back the
transaciton");
ex.printStackTrace();
}
}
finally
{
p.idleConnection(connection);
pm = null;
connection = null;
rs = null;
update = null;
select = null;
p = null;
}