You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Roy K. Mayr R." <sy...@uapar.edu> on 2001/10/29 16:48:41 UTC

nested ResulSet

Hi...

I'am using JDBC Progress Driver (Type 2), PoolMan2.1beta, Tomcat 4, JDK1.4,
WinNT and this
driver need that I close manually every both ResultSet and
PreparedStatement.  I have problem when I use two nested ResultSet with same
connection...

For example...
(extract from bean...)

 private void cargarPlanPoli()  {
  planPolitica = new Vector();
  String c[] = new String[3]; // idplan, nombre, checked
  int IDPlan;
  try {
   stPlan = conexion.prepareStatement(sqlPlan);
   rsPlan = stPlan.executeQuery();
   while(rsPlan.next()) {
    IDPlan = rsPlan.getInt("IDPlan");
    stPlanPoli  = conexion.prepareStatement(sqlPlanPoli);
    stPlanPoli.setInt(1, this.idPolitica);
    stPlanPoli.setInt(2, IDPlan);
    rsPlanPoli = stPlanPoli.executeQuery();
    c[0] = Integer.toString(IDPlan);
    c[1] = rsPlan.getString("nombre");
    if(rsPlanPoli.next()) {
     c[2] = "s";
    }
    else {
     c[2] = "n";
     rsPlanPoli.close();
     stPlanPoli.close();
    }
    planPolitica.addElement(c.clone());
   }
   rsPlan.close();
   stPlan.close();
  } catch (SQLException e) {
   System.out.println("Error en cargarPlanPoli(): " + e.getMessage());
  }
 }

When I close connection... poolman throw
java.util.ConcurrentModificationException in PoolManConnection.clean(),
KeyIterator.next(WeakHashMap)

(1).  I'm using correctly ResultSet, PrepareStatement, Connections....??
With previous PoolMan (2.0.4), all fine !! (I think....)
(2). Must I to use two connections ?

What is wrong..... Thanks for advance !!!!

Roy



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>