activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jefetech <i...@jefetech.com>
Subject Re: ActiveMQ Ajax not closing Mysql Connection
Date Mon, 31 Jul 2006 18:19:38 GMT

I may be confused here, but I shoudn't be using ActiveMQ's data source. 
Since from the JavaScript I'm making an Asyn call to a struts application
which is doing the hibernate stuff and just spitting back plain text, why is
ActiveMQ controlling the connection?   This is the simple logic in the
struts app:


    public static List getUsers() {
        
        Session session = null;
        List callerList = null;

       try{
            // This step will read hibernate.cfg.xml and prepare hibernate
for use
            SessionFactory sessionFactory = new
Configuration().configure().buildSessionFactory();
            session =sessionFactory.openSession();
             
            
              //Using from Clause
             String SQL_QUERY = SQL.getUsers;
             Query query = session.createQuery(SQL_QUERY);
             callerList = query.list();
             
             session.flush();
             session.close();
             
          }catch(Exception e){
              //System.out.println(e.getMessage());
          }finally{
              try {
                  if (session != null) {
                      session.flush();
                      session.close();
                  }
              } catch (Exception e) {} 
         }
        
        return callerList;
        
      }  
-- 
View this message in context: http://www.nabble.com/ActiveMQ-Ajax-not-closing-Mysql-Connection-tf2029061.html#a5581183
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message