-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problem with persistence.xml
PostPosted: Thu Sep 01, 2005 5:16 pm 
Newbie

Joined: Wed Aug 31, 2005 5:56 pm
Posts: 5
Hi, I'm using JBOSS and EJB3 with Hibernate Annotations. All the time I worked with the EntityManager and it works fine. But now we have much more complex queries and I need to have a SessionFactory.
I added the Session Factory to the persistence.xml like this (also i tried it in the hibernate.cfg.xml) but he always brings up this:

Quote:
javax.naming.NameNotFoundException: managedEntityFactory.fidsdbsession not bound


All the mapping I do in the code is with Annotations. So there are no mapping XMLs.

Here is my persitence.xml

Code:
xml version="1.0" encoding="UTF-8"?>

<entity-manager>

  <name>fidsdbmanager</name>
  <jta-data-source>java:/OracleDS</jta-data-source>
  <properties>
   <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
   <property name="hibernate.hbm2ddl.auto" value="select"/>
   <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook" />
   <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache" />
  </properties>

</entity-manager>

<session-factory>
   <name>fidsdbsession</name>
     <jta-data-source>java:/OracleDS</jta-data-source>

   <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect"/>
      <property name="hibernate.hbm2ddl.auto" value="select"/>
      <property name="hibernate.cache.provider_class" value="org.jboss.ejb3.entity.TreeCacheProviderHook" />
      <property name="hibernate.treecache.mbean.object_name" value="jboss.cache:service=EJB3EntityTreeCache" />
   <!-- Mapping files -->
   <mapping package="com.airit.fidsdb.entity">
   <mapping class="com.airit.fidsdb.entity.*">
</session-factory>


Please... Someone out there... HELP me :-)
At least to find a good documentation for that stuff...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 4:50 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You can get the EntityManagerFactory and do
( (HibernateEntityManagerFactory) emf).getSessionFactory();

or
( (HibernateEntityManager) em).getSession().getSessionFactory();

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.