title: Connection within GlassFish, weird behavior?
body: <p>I had this general question : can a connection pool keep in cache some "ancient" connection and serve it while an other one is called ? I know it somehow does, but does it use connection objects already created via some DataSource while I explicitly changed the lookup into that Datasource to a new JNDI adresse and, with this new lookup, created a new connection (which I was hoping to use, that is) ?</p>
  
  <p>To be a bit specific, here were my steps : </p>
  
  <p>I've created a connection in my GlassFish server, given it a name in the JNDI,  used that in my code as follows : </p>
  
  <pre><code>InitialContext ctx = new InitialContext();
           //The JDBC Data source that we just created
          DataSource ds = (DataSource) ctx.lookup("postgresJNDI");
          Connection connection = ds.getConnection();
          Statement st = connection.createStatement();
  
          ResultSet rs = st.executeQuery("SELECT util_firm, util_name, previlege FROM utilisateur WHERE password = '" + password + "' AND pseudo = '" + pseudo + "' ") ;
  </code></pre>
  
  <p>problem is once the request is send I get back an alert stating that : </p>
  
  <pre><code>serverError: class javax.faces.el.EvaluationException the name of column utilfirm was not found in this ResultSet.
  </code></pre>
  
  <p>And utilfirm is not even in my request, neither is it on my database for that matter (but was on an ancient one I've erased, one that was accessed via an other JNDI addresse...).</p>
  
  <p>I might add that I've taken care of closing every connection I used.</p>
  
  <p>So is this normal ? Or is it something in my configuration ? </p>
  
  <p>Thanks in advance. </p>