1 package org.logicalcobwebs.proxool; 2 3 import org.hibernate.Session; 4 import org.hibernate.SessionFactory; 5 import org.hibernate.HibernateException; 6 import org.apache.commons.logging.Log; 7 import org.apache.commons.logging.LogFactory; 8 9 16 public class Hibernate3SpringTest extends AbstractSpringIntegrationTestBase { 17 18 private static final Log LOG = LogFactory.getLog(Hibernate3SpringTest.class); 19 20 public void testSimpleConnection() throws ProxoolException { 21 String alias = "memtest"; 22 23 SessionFactory sf = (SessionFactory) applicationContext.getBean("sessionFactory"); 24 Session session = null; 25 try { 26 session = sf.openSession(); 27 } catch (HibernateException e) { 28 fail("Could not open a Hibernate connection from the pool " + e.getMessage()); 29 throw e; 30 } finally { 31 try { 32 session.close(); 33 } catch (HibernateException e) { 34 fail("Could not return a Hibernate connection to the pool " + e.getMessage()); 35 throw e; 36 } 37 } 38 } 39 } 40 | Popular Tags |