This discussion is archived
1 Reply Latest reply: Jun 18, 2012 6:34 AM by cdelahun RSS

JPA AND HIBERNATE (createquery PB)

943947 Newbie
Currently Being Moderated
Hi,

I have an issue in jpa-hibernate program :
try{
List dmvs = em.createQuery("select c from Dmv as c order by c.num ASC").getResultList();
System.err.println("found finsh");

if (dmvs==null ||dmvs.size() == 0) {
     return -1;
}
for (Iterator iter = dmvs.iterator(); iter.hasNext();) {
Dmv element1 = (Dmv) iter.next();***

.......

}
}catch(Exception x){
x.printStackTrace();
}
the problem is that the em.creatyQueury after 1 or 2 days is blocked and don't return data or exception error !!

Edited by: user12936212 on 15 juin 2012 03:36

Edited by: user12936212 on 15 juin 2012 03:45
  • 1. Re: JPA AND HIBERNATE (createquery PB)
    cdelahun Pro
    Currently Being Moderated
    Hello,

    You will need to debug your application and obtain a java thread dump when the problem occurs, and possibly check out the locks in the database to see what might be causing the issue. As you are using Hibernate, you might want to post your product specific questions on the particular product forum - or try using TopLink/EclipseLink as the JPA provider and see if you get the same issue.

    Best Regards,
    Chris

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points