EntityManagerFactory « Core « JPA Q&A





1. Issue while getting the Hibernate EntityManagerFactory in Weblogic (EJB3 Application)    stackoverflow.com

I am facing an issue when am getting the EntityManagerFactory from JPA from the following code in weblogic StartUp Class


    EntityManagerFactory emf =
     ...

2. Error creating Envers's EntityManagerFactory when annotations are present    stackoverflow.com

Envers looks easy. Just add some hibernate properties in your persistence.xml (eventlisteners), and annotate the entities you want to audit. I am testing this on an application using Hibernate. Here is some ...

3. Finding the current persistence unit for the current EntityManagerFactory    stackoverflow.com

I noticed that calling createEntityManagerFactory(null) will use the default Persistence Unit (PU) in the configuration file. Sometimes the classpaths get really messed up at deployment and I'd really like to ...

4. EntityManagerFactory error on Websphere    stackoverflow.com

I have a very weird problem. Have an application using Hibernate and spring.I have an entitymanger defined which uses a JNDI lookup .It looks something like this

<bean id="entityManagerFactory"
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
 ...

5. How to share EntityManagerFactory Object across the various Resource files in a Restlet application?    stackoverflow.com

I would like to create one EMF object and use it in various Resource class objects.. any ideas on how to do this?

6. use of EntityManagerFactory causing duplicate primary key exceptions    stackoverflow.com

Hey guys, my goal is create an EntityManager using properties dependent on which database is in use. I've seen something like this done in all my Google searches(I made the ...

7. Does executing EntityManagerFactory.createEntityManager() reutrn new instance each time?    stackoverflow.com

Does executing EntityManagerFactory.createEntityManager() reutrn new instance each time? or it returns the cached copy of the same EntityManager each time?

8. When should we close the EntityManagerFactory?    stackoverflow.com

I am pretty new on the ORM's. I just start to read books and documents about Java Persistence API with Hibernate. I just wondered, closing EntityManagerFactory is similar with jdbc database ...

9. How to create a thread safe EntityManagerFactory?    stackoverflow.com

I'm working on a application that needs to do some database operations. I created a static variable for EntityManagerFactory and Intialized it in the method that gets called by the application

 if ...





10. Unable to configure EntityManagerFactory    stackoverflow.com

I am new to JPA & hibernate. In my web-app i have changed my JDBC codes to JPA. While running the web-app i am getting a BIG list of errors. But ...

11. Creating an EntityManagerFactory manually?    stackoverflow.com

Does anyone know how to create an EntityManagerFactory manually? When I say manually I mean have it consume a special persistence.xml file? This what I have tried and all has ...

12. Playframework: JPA error occurred (Unable to build EntityManagerFactory)    stackoverflow.com

I started to contribute to one Play project in Java, downloaded code, created Play project, added libraries and set all I could and then created database. Finally everything seemed to be ok, ...

13. JavaEE 6: java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName null    stackoverflow.com

Yesterday when I was working on my JavaEE application, it was happily getting deployed to Glassfish 3.1 and all the [web, ejb, jpa] engines were working and I was able to ...

14. Best practice to get EntityManagerFactory    stackoverflow.com

What is the best approach to get EntityManagerFactory in web app(jsp/servlets). is this a good way When should EntityManagerFactory instance be created/opened?, or it's better get it from JNDI, or something else... ...

15. OpenJPA EntityManagerFactory problem    coderanch.com

16. Glassfish v3 & JPA... having difficulty with EntityManagerFactory...    java.net

WARNING: StandardWrapperValve[Main]: PWC1406: Servlet.service() for servlet Main threw exception java.lang.NullPointerException at org.darkhelm.playlist.data.jpa.EMF.getEM(EMF.java:28) at org.darkhelm.playlist.data.jpa.DailyList.getDateGenerated(DailyList.java:85) at org.darkhelm.playlist.generator.Step$1.start(Step.java:52) at org.darkhelm.playlist.generator.Step$9.run(Step.java:477) at org.darkhelm.playlist.generator.Step.run(Step.java:483) at org.darkhelm.playlist.generator.Step.run(Step.java:461) at org.darkhelm.playlist.servlets.MainServlet.doGet(MainServlet.java:32) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641) at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97) at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185) at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:332) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:233) at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791) at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693) at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954) at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170) at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135) at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102) at ...





17. EntityManagerFactory close() not closing all EntityManagers    forum.hibernate.org

Hi All, I am using Hibernate 3.4. GA and had a question about the behavior of the EntityManagerFactory close() method. The way I use Hibernate is that I create a single EntityManagerFactory and then use a Factory pattern to lookup an EntityManager from a ThreadLocal and if one does not exist I create one. In order to avoid using a stale ...

18. EntityManagerFactory leaves DB connections open    forum.hibernate.org

In my web application (a Servlet) I create and use an EntityManagerFactory and then shut it down with the close() method in my servlet destroy() method. However, when I shut down my web application MySQL admin console shows me that there is still an open connection to the database. I can see the hibernate log statement saying it has closed, but ...

19. Foreign Keys and "Unable to build EntityManagerFactory" err.    forum.hibernate.org

Author Message mailhaim Post subject: Foreign Keys and "Unable to build EntityManagerFactory" err. Posted: Tue May 25, 2010 2:16 am Newbie Joined: Mon May 24, 2010 3:25 pm Posts: 6 I've added foreign key (for the 1st. time...) and getting "Unable to build EntityManagerFactory" exception. Any ideas what is the problem? The JOBS.COMPANY_ID is defined as foreign key to ...

20. why i am getting Unable to configure EntityManagerFactory?    forum.hibernate.org

why i am getting Unable to configure EntityManagerFactory? what is the problem in my persistence.xml(which is place in META-INF folder? org.hibernate.ejb.HibernatePersistence Student ---------- RUN ---------- 62 [main] ...

21. EntityManagerFactory has not been created for PU    forum.hibernate.org

Hello, Can anyone tell me what is going on with my project setup? I have created some entities which are mapped from DB2 database, and created an entity manager class like this: @JPAManager(targetEntity=au.abc.ejb.entity.MyEntityManager.class) @SuppressWarnings("unchecked") public class MyEntityManager { @PersistenceUnit private EntityManagerFactory emf; .... } I got the following runtime exception: 18/02/11 11:25:32:100 EST 00000024 BusinessExcep E CNTR0019E: EJB threw an unexpected ...

22. Exception on creating EntityManagerFactory    forum.hibernate.org

Hi! After having some trouble with another implementation of JPA I just tried Hibernate 3.6.2 to see if it might work better. However, I had no luck to get it working. On Persistence.createEntityManagerFactory(persistenceUnit, jpaProperties); an exception with the following stacktrace occurs: Code: javax.persistence.PersistenceException: [PersistenceUnit: persunit] Unable to configure EntityManagerFactory at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:375) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:56) ...

23. Unable to build EntityManagerFactory Error    forum.hibernate.org

Author Message dj127910 Post subject: Unable to build EntityManagerFactory Error Posted: Thu Oct 06, 2011 12:00 am Newbie Joined: Wed Oct 05, 2011 11:47 pm Posts: 1 I'm trying to convert a simple application-managed entity manager program from EclipseLink to Hibernate but I some reasons I'm getting the following errors, if anyone can give me some suggestions that would ...

25. Problem bootstrapping EntityManagerFactory    forum.hibernate.org

Regular Joined: Thu Jul 29, 2004 11:55 pm Posts: 75 Hi, I am having problems bootstrapping my EntityManagerFactory based on 2.2.2 in the manual. I have this code to check to see if my persistence.xml is in the path Code: private void initializeFactory() { ClassLoader loader; ...

26. A problem about EntityManagerFactory    forum.hibernate.org

27. ConcurrentModificationExcp creating EntityManagerFactory    forum.hibernate.org

@Entity @Table(name="MY_ORDER") public class Order { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="order_id") private long id; @Column(name="qty", nullable=false) private String quantity; @Column(name="item_cd", nullable=false) private String item_code; ...

28. Websphere EntityManagerFactory creation problem    forum.hibernate.org

org.hibernate.ejb.HibernatePersistence jdbc/OracleJDBCDriverXADataSource gov.tubitak.frameworks.domain.Framework true ...

29. Adding annotated classes to non-custom EntityManagerFactory    forum.hibernate.org

Hi Guys, I'm working in an environment where each client has your own database schema, but all of them with the same tables. To use JPA(w/ hibernate behind the scenes) I'm creating the EntityManagerFactory using Ejb3Configuration. So far so good, but I have a lot of classes, all of them mapped in my persistence.xml file. I would like to know if ...

30. Unable to build EntityManagerFactory    forum.hibernate.org

Hello, I'm trying to create an EntityManagerFactory but it doesn't seem to work. I always get this Error message. javax.persistence.PersistenceException [PersistenceUnit: webshop] Unable to build EntityManagerFactory Code: private static final String PERSISTENCE_UNIT = "webshop"; public static void init() { emf = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT); } This is ...

31. Unable to build EntityManagerFactory    forum.hibernate.org

Hey, all. I just registered here because I'm in real trouble 'cause a PersistenceException on JBoss 5.0 I'm working on an Enterprise Application project on Eclipse Ganymede (3.4.2), with JBoss 5.0, JPA, JSF and Hibernate. I have three modules inside the EAR: EJB, JPA and WEB. The JPA one is the one giving me trouble. Once I deploy and try to ...