aspose file tools*
The moose likes Beginning Java and the fly likes EJB, JPA- Persistence exception while trying to find Entity manager instance using EntityClass Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "EJB, JPA- Persistence exception while trying to find Entity manager instance using EntityClass" Watch "EJB, JPA- Persistence exception while trying to find Entity manager instance using EntityClass" New topic
Author

EJB, JPA- Persistence exception while trying to find Entity manager instance using EntityClass

Ashley Sherman
Greenhorn

Joined: May 26, 2012
Posts: 2


Hi,

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;

em.find(AccountStatus.class, loginId).

When i try to run, I am getting the below exception at the above line.

<openjpa-1.2.3-SNAPSHOT-r422266:1152904 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: Io exception: Software caused connection abort: recv failed {prepstmnt 742468673 SELECT t0.accountDisabled, t0.badLoginCount, t0.badLoginLockoutTimestamp, t0.badSelfServiceCount, t0.badSelfServiceLockoutTimestamp, t0.lastModified FROM CP_SEC.AccountStatus t0 WHERE t0.loginID = ? [params=?]} [code=17002, state=08006].

i would really appreciate if any one can help me understand the issue.

Thanks,
-Mazem
Ashley Sherman
Greenhorn

Joined: May 26, 2012
Posts: 2

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.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19696
    
  20

Ignore EJB or JPA - the problem lies deeper.

Newwww bieeeee wrote:Io exception: Software caused connection abort: recv failed

That's the main issue, and it indicates there is a network connection problem between your container and your database server.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB, JPA- Persistence exception while trying to find Entity manager instance using EntityClass