database « EntityManager « JPA Q&A





1. JPA EntityManager deletes all records in database    stackoverflow.com

I have one Servlet that does insertion into my database. This is working fine. A second Servlet displays what the first one has inserted, however whenever I run the displaying Servlet, ...

2. sync entitymanager from database    stackoverflow.com

i have a swing desktop application that use a entitymanagerfactory, but when this application is executed many times at the same time, the diferents entity managers have old data that was ...

3. JPA EntityManager: merge() is trying to create a new row in the db - why?    stackoverflow.com

I'm using JPA through the Play Framework. I'm checking to see if a User object is cached, and if so I retrieve it and merge() it such that I can update fields ...

4. Trying to find an entity in the database    stackoverflow.com

I have a code like this:

AJPAController aJPAController;
AClass aClass = aJPAController.find((Integer.parseInt(request.getParameter("id")));

try{
    if(aJpaController.contains(aClass)){
       response.sendRedirect("gosomewhere.com");
     }
}
catch (java.lang.NullPointerException R){
    ...

5. EntityManager Lifecycle when using Oracle's Virtual Private Database    stackoverflow.com

I had a few questions all related to the way an entity manager is created and used in an application with respect to Virtual Private Databases, which is a feature in ...

6. EntityManager gracefully handle database restart?    forum.hibernate.org

In my servlet based webapp, I use the hibernate 3.5.0.Beta-1 EntityManager to access a postgres db. Sometimes the postgres db needs to be restarted. Whenever this happens the next query from my EntityManager fails like this: Quote: Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:97) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.loader.Loader.doList(Loader.java:2235) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129) at org.hibernate.loader.Loader.list(Loader.java:2124) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:411) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at ...