Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ashley Sherman
Greenhorn
Posts: 2
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20546
57
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic