This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am using JPA 1.0 with EJB 3.0,
I have created an Entity Class "AccountStatusClass" for the table "AccountStatus" which stores the status of all the users,LoginId is the primary Key.
Iam using the entity manager instance to query a particular entity instance using the Entity Class "AccountStatusClass" and also the primary key "LoginId" as below.
@PersistenceContext(unitName="PersistenceUnitName")// defined the PersistenceUnitName in the persistence.xml file and also added required <jta-data-source> and the entity classes <class>.
private EntityManager em;
When i try to run, I am getting the below exception at the above line.
One more note: I get this error when i try to run the application for the first time, if i retry i dont see this error . The error is intermittent. Is it an issue with something like Stale connections.
Could some one please clarify who has worked with JPA.