-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Configured SessionFactory: null
PostPosted: Sat Mar 10, 2007 4:50 pm 
Newbie

Joined: Thu Feb 22, 2007 11:47 pm
Posts: 11
When my application starts up using Hiberate, I see a message:

INFO - Configured SessionFactory: null

Is this ok?

Thanks, Steve



Here is my hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.datasource">java:comp/env/jdbc/dataSource</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

</session-factory>

</hibernate-configuration>


Top
 Profile  
 
 Post subject: Configured SessionFactory:null
PostPosted: Tue Mar 13, 2007 5:30 am 
Beginner
Beginner

Joined: Tue Dec 12, 2006 7:52 am
Posts: 20
hi

this is data source creationg on tomcat server you try like this

<hibernate-configuration>
<session-factory name="java:hibernate/SessionFactory">

<!-- datasource connection properties -->
<property name="connection.datasource">java:comp/env/MySqlDS</property>
<!-- dialect for MySQL -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Mapping files -->
<mapping resource="com/gssamerica/expensereporting/business/mappings/Address.hbm.xml"/>
</hibernate-configuration>

You get the sessionFactory object and overcome you r error


Top
 Profile  
 
 Post subject: Re: Configured SessionFactory: null
PostPosted: Tue Mar 13, 2007 5:43 am 
Newbie

Joined: Tue Mar 13, 2007 4:15 am
Posts: 12
Location: Trivandrum
ginchez wrote:
When my application starts up using Hiberate, I see a message:

INFO - Configured SessionFactory: null

Is this ok?

Thanks, Steve



Here is my hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.datasource">java:comp/env/jdbc/dataSource</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

</session-factory>

</hibernate-configuration>


r u able to connect to DB

_________________
Regards
Belto


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 9:20 am 
Newbie

Joined: Thu Feb 22, 2007 11:47 pm
Posts: 11
Yes, my application runs fine. I was just wondering why the SessionFactory is showing as null?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 13, 2007 11:37 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
ehh, you're probably fine. You're probably just initializing your SessionFactory after your program runs some default check on it.

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.