Advertisement

03.07.2006 at 07:20PM PST, ID: 21764799
[x]
Attachment Details

Hibernate - Cannot open connection ( SessionFacotoryName = null )

Asked by LeanMoreTryMore in Java Programming Language, J2EE

Tags: open, hibernate, connection, cannot

I use hibernate to connect Oracle data base. The program got error while connecting to Oracle database.

I run from debugger and found out the SessionFactoryName is null. Is it causing the connection problem.??

See my code below
===========================================================================
   Configuration configuration = new Configuration();
   configuration.setEntityResolver(new ImportFromClasspathEntityResolver());
   sessionFactoryName = configuration.getProperty(Environment.SESSION_FACTORY_NAME);
   String txn_strategy = configuration.getProperty(Environment.TRANSACTION_STRATEGY);
   if (sessionFactoryName != null) {
      configuration.buildSessionFactory();
   } else {
      sessionFactory = configuration.buildSessionFactory();
   }

public static void beginTransaction() throws InfrastructureException {
   try {
      getSessionFactory().getCurrentSession().beginTransaction();   <=== error here
    } catch (Exception e) {
      throw new InfrastructureException(e);
    }
}


configuration file
===========
<hibernate-configuration>
<session-factory>
   <property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
   <property name="hibernate.connection.url">jdbc:oracle:thin:@111.222.40.107:1521:dev</property>
   <property name="connection.username">myUser</property>
   <property name="connection.password">myPassword</property>
   <property name="connection.pool_size">1</property>
   <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
   <property name="current_session_context_class">thread</property>                  
   <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
   <property name="connection.isolation">1</property>
   <property name="hibernate.connection.release_mode">auto</property>
   <property name="show_sql">false</property>
   <property name="hibernate.format_sql">true</property>
   <property name="hibernate.jdbc.batch_size">10</property>            
   <property name="hibernate.cglib.use_reflection_optimizer">true</property>
   <property name="cache.use_second_level_cache">false</property>
</session-factory>
</hibernate-configuration>


==
Please advise and pinpoint where it goes wrong.

Many thanks in advanceStart Free Trial
[+][-]03.07.2006 at 10:46PM PST, ID: 16130712

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:02AM PST, ID: 16131486

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 10:51AM PST, ID: 16136939

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:46PM PST, ID: 16139558

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:48PM PST, ID: 16139578

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:49PM PST, ID: 16139589

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:50PM PST, ID: 16139595

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 02:54PM PST, ID: 16139649

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:19PM PST, ID: 16139894

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:40PM PST, ID: 16140059

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:41PM PST, ID: 16140065

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:42PM PST, ID: 16140070

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:43PM PST, ID: 16140080

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:44PM PST, ID: 16140083

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:44PM PST, ID: 16140084

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:46PM PST, ID: 16140091

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:48PM PST, ID: 16140110

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:51PM PST, ID: 16140127

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:52PM PST, ID: 16140138

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:54PM PST, ID: 16140152

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:58PM PST, ID: 16140177

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 03:58PM PST, ID: 16140178

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Java Programming Language, J2EE
Tags: open, hibernate, connection, cannot
Sign Up Now!
Solution Provided By: objects
Participating Experts: 3
Solution Grade: A
 
 
[+][-]03.08.2006 at 03:58PM PST, ID: 16140180

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.08.2006 at 04:09PM PST, ID: 16140245

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32