database « EntityManager « JPA Q&A

1. JPA EntityManager deletes all records in database

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

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?

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

I have a code like this:

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

catch (java.lang.NullPointerException R){

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

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?

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( at org.hibernate.exception.JDBCExceptionHelper.convert( at org.hibernate.loader.Loader.doList( at org.hibernate.loader.Loader.listIgnoreQueryCache( at org.hibernate.loader.Loader.list( at org.hibernate.loader.hql.QueryLoader.list( at org.hibernate.hql.ast.QueryTranslatorImpl.list( at org.hibernate.engine.query.HQLQueryPlan.performList( at ...