• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring jdbcTemplate is stuck at Fetching JDBC Connection

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having issue with spring jdbcTemplate. It used to work fine but now it doesn't return any value neither error message. My table size has grown considerably large, around 35 million records which could be a reason for this.

But my main concern is that jdbcTemplate is not throwing any exception neither releasing the control to next line of code and my application breaks. I would like the jdbcTemplate to release connection if for some reason it is unable to perform the query operation. Below is my code, data source details and log statements that I get from log4j after enabling debug logs. Nothing is logged after Fetching JDBC connection.



Data Source configuration



Logs:




 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First why are processing a very huge dataset (35 million records) at once.?

When do you expect the jdbctemplate to release connection for you?
If you want the query should to be executed within some time, then you can use setQueryTimeout(int queryTimeout) method of the JdbcTemplate, after this timeout, jdbctemplate releases the connection.
 
K Bspring
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am running the query with limit 500 on a table that large. I added jdbcTemplate().setQueryTimeout(3) but it didn't help.
Also added maxWait to configuration.


My concern is jdbcTemplate is not logging anything after Fetching JDBC connection.. shouldn't it throw an exception if something is going wrong, instead of getting stuck.
 
Prasad Krishnegowda
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like it is not able to obtain the connection from the data source..

First, check if their are conflicting spring jar versions in your classpath.
Next, can you show us your complete java code? Are you doing something outside the QueryForRowList method?


 
Yeah, but does being a ninja come with a dental plan? And what about this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic