title: Whenever I call a webservice path the class gets initialized
body: <p>I have a Restful webservice. </p>
  
  <pre><code>    @Path("/attributes")
      class A
      {
       MySqlConnection myConn = new MySqlConnection();
       @Path("getappslist")
       function B()
       {
         //query to create temp table here
       }
       @Path("getfilteredapps")
       function C()
       {
         //trying to access temp table
       }
      }
  </code></pre>
  
  <p>The issue is I am creating a temp table inside the method B of class A. Now when I try to call method C of class A by using the path /attributes from UI the class A is getting initialized every time and so a new MySql connection is getting established. Hence I couldn't access the temp table in method C. Is there a way that I can avoid this from happening?</p>
  
  <p>I also heard about heap tables but I couldn't get details online about how long it can exist. I just want a temp table which gets deleted after I sign out of the application. Any help is much appreciated.</p>