Hi,
naveen0403 wrote:
Hi I am using
Oracle9i Release2,
jdbc Driver for 9.2.0.1 for jdk 1.4- ojdbc14.jar.
When I start tomcat, in my ContextListener, I try to create
SessionFactory by doing new Configuration().configure("/hibernate_astronomy.cfg.xml").buildSessionFactory();
it just hangs, it never prints the println statement after this line. During debugging, I realised that Hibernate is trying to get the connection as it prints out this on command prompt of Tomcat-
Nov 26, 2003 3:40:33 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
Nov 26, 2003 3:40:33 PM net.sf.hibernate.dialect.Dialect <init>
INFO: Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
Nov 26, 2003 3:40:34 PM net.sf.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext properties:{}
Nov 26, 2003 3:40:34 PM net.sf.hibernate.connection.DatasourceConnectionProvider
configure
INFO: Using datasource: java:comp/env/jdbc/astronomyDS
Nov 26, 2003 3:40:34 PM net.sf.hibernate.impl.SessionFactoryImpl <init>
INFO: Use outer join fetching: true
which means it is stuck at
Connection conn = connections.getConnection();
in SessionFactoryImpl
I am stuck. Any help is highly appreciated.
you can create a Thread dump on the JVM process running tomcat to get the code causing the hung. This is done by kill -3 on Unix/Linux and CLTR-break on Win32.
There are many place that create a deadlock or a race condition. May be JDBC driver or maybe the connection pool (are you using commons-dbcp?).