Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Does execute() statement run forever if I lose connection to MYSQL during query

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note: Sorry in advance, this is my first time posting a question on this site

So the high level view, I'm using execute() in Java to run a INSERT statement. The statement is bouncing off quite a large table. Sometimes 8+ millions rows are being inserted and i'm using my CPU to run it.
Normally the execution time is around 50 minutes.

So now the problem.

In MYSQL, the table i'm inserting into does get populated with data (all of it). But, when I go to SELECT from that table, MYSQL shoots a error message -- Error Code: 2013: Lost Connection to MYSQL server during query
I do not receive that error message until I try to query off the database.

Java however, keeps running and never throws an error.

Is there any error handling I can throw to let Java know that MYSQL connection has timed out?


 
Sheriff
Posts: 7113
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!  No need to apologize, we're all friendly here (mostly).

Have you tried increasing the timeout length of your connection pool?  That's just a guess but it helped me when I was having a similar problem.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic