db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Ignacio Villa <ji_vi...@yahoo.es>
Subject Re: Garbage Collector and memory
Date Thu, 27 Oct 2005 10:19:32 GMT
Thanks.
I resolve it. But i dont mind the difference between
rs.executeQuery() and rs.executeQuery(sql). Whith the
fist one i get the outOfMemory exception.


class.forName("org.apache...");
Connnection DBcon =
DriverManager.getConnection("jdbc:derby:....");
String Sql = "";
Statement Consulta
=DBcon.createStatement(ResultSet.TYPE_SCROLL_INSENTISIVE,
ResultSet.CONCUR_READ_ONLY);

try
{
  for (int i =1; i< 5000; i++)
  {
  Sql = "Select .... from... where...";  //use of
variables to make a lof of queries.

  ResultSet rs = Consulta.executeQuery(Sql);
 try
  {
    //rs management.
  }
  catch (.....

}

try
{
  Consulta.close();
  DBcon.close();
  System.gc();
  System.gc();
}
catch ...



//Greeting to all.




 --- ji_villa <ji_villa@yahoo.es> escribió:

> El mar, 25-10-2005 a las 13:56 +0200, Fernanda
> Pizzorno escribió:
> > Juan Ignacio Villa wrote:
> > 
> > >[...]
> > >
> > >  Consulta =
> >
>
>DBConexion.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
> > >  Rs = Consulta.executeQuery(sql);
> > >
> > >[...]
> > >
> > Hello,
> > 
> > Scrollable sensitive result sets
> (ResultSet.TYPE_SCROLL_SENSITIVE) are 
> > not implemented
> > in Derby. Scrollable insensitive result sets 
> > (ResultSet.TYPE_SCROLL_INSENSITIVE) are
> > implemented in Derby, but only with concurrency
> ResultSet.CONCUR_READ_ONLY.
> > 
> > If your application needs updatable result sets
> (ie. if you are going to 
> > use updateXXX,
> > updateRow(), insertRow() or deleteRow() methods),
> you will have to use 
> > forward only result
> > sets (ResultSet.TYPE_FORWARD_ONLY), and you will
> only be able to move 
> > between rows in the
> > result set using next().
> > 
> > On the other hand, if you do not need to use
> updatable result sets, you 
> > can use scrollable
> > insensitive result sets. The difference between
> this type and the one 
> > you are using is that
> > it is not sensitive to changes to the underlying
> table.
> > 
> > Since the result set type and concurrency you are
> trying to use are not 
> > implemented in
> > Derby, the driver will generate a SQLWarning. And
> you can check the type 
> > and concurrency
> > of the result set returned by the driver using
> ResultSet.getType() and
> > ResultSet.getConcurrency() respectively.
> > 
> > Fernanda
> > 
> 
> Thanks Fernanda. But i prove with
> ResultSet.TYPE_SCROLL_INSENSITIVE and
> ResultSet.CONCUR_READ_ONLY and i get an out of
> memory error too.
> Only works fine with ResultSet.TYPE_FORWARD_ONLY.
> 
> Statements or preparedStatements fail equals. Both
> give me the out of
> memory error.
> 
> The code of Dyre (thaks Dyre) fails too.
> 
> System.gc also not free memory.
> Catch exceptions not solve it.
> Yes, bad code.
> 
> I am proving to resolve it.
> ¿Is extrange? Would be.
> 
> ...and very thanks.
> 
> Villa.
> 



		
______________________________________________ 
Renovamos el Correo Yahoo! 
Nuevos servicios, más seguridad 
http://correo.yahoo.es

Mime
View raw message