Ugh.... nevermind. Banged my head some more, read some more Hibernate docs so i 
could wrap my head around it, and finally figured it out. For all the other 
newbies out there, searching for the answers - the hibernate.cfg.xml is read 
when the sessionFactory is created only when you use the configure() method. As 
reference for others, my session is created with something like this...

public static final ThreadLocal session = new ThreadLocal();
  | private static final Configuration cfg = new Configuration();
  | private static SessionFactory sf;
  | 
  | try {                                                               
  |     sf = cfg.configure().buildSessionFactory();
  | }
  | catch(Exception e) {
  |    System.err.println("%%%% Error Creating SessionFactory %%%%");
  |    e.printStackTrace();
  | }
  | s = sf.openSession();
  | session.set(s);
  | 

and my hibernate.cfg.xml file looks like this...

  | <hibernate-configuration>
  |     <session-factory>
  |             <property name="connection.datasource">java:PortalDS</property>
  |             <property 
name="session.factory_name">java:portal/SessionFactory</property>
  |             <property 
name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
  |             <property 
name="cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</property>
  | 
  |             <property name="show_sql">false</property>
  | 
  |             <mapping resource="com/example/MyClass.hbm.xml"/>
  |     </session-factory>
  | </hibernate-configuration>

I'm sure that's not all perfect, but it got me where i wanted to go today. ... 
.joe


View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3868086#3868086

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3868086


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
JBoss-Development@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to