This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Spring-Hibernate database calls stops responding after a few calls

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,

I have developed one application, in that while i am running application database calls stops responding after a few calls am not getting the results form the database
here my hibernate and spring versions are
spring---4.1.6.RELEASE
hibernate ---4.3.6.Final

i have used latest versions and old versions also for the both, even though i am facing same issue
please help me out friends
please suggest me for resolving the issue

thank you for advance
 
Rancher
Posts: 4270
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Logs?
Are you eating exceptions, possibly?

How do you know it's attempting to access the database?
Does the code lock up?

In short, you need to provide a lot more info into what you've already investigated.
 
Constantine Mahesh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
i have took the logs also even though facing same issue
please see the attached screen shot in that query hitting the database
1.PNG
[Thumbnail for 1.PNG]
Hitting Databse
 
Dave Tolls
Rancher
Posts: 4270
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any debug (or trace) logging around that area for you to track what's going on.
And what's that additional try/catch around rethrowing the exception for?

And it's generally preferable to post actual code rather then images...it's harder to quote an image.
 
Constantine Mahesh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
the below code is i am facing issue
please try to resolve as soon as possible
here i have written try and catch blocks for if we are getting exception

please help me out.........

@SuppressWarnings({ "unchecked" })
public List<ScreenMovieDetails> listMoviesByCityId(int cityId){
//Session session = sessionFactory.openSession();
//session.setFlushMode(FlushMode.COMMIT);

Session session = sessionFactory.getCurrentSession();
List<ScreenMovieDetails> ScreenMovieDetailsList = null;
Criteria criteria = session.createCriteria(ScreenMovieDetails.class);
criteria.add(Restrictions.eq("city_id",cityId));
try {
ScreenMovieDetailsList = criteria.list();
} catch (Exception e) {

try {
throw e;
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}

return ScreenMovieDetailsList;


}

 
Dave Tolls
Rancher
Posts: 4270
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I was commenting on that extra try/catch block.
Why not simply print the stack trace the first time?

As I say, there appears to be no debug logging in there to trace where things are stopping.
 
Won't you please? Please won't you be my neighbor? - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!