• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

mysql restore hangs forever

 
Ranch Hand
Posts: 32
MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm trying to restore data using mysql command.

Here is the code to take backup.


And finally here is the code for restore



Backup works perfect but restore hangs for ever....

Tried the same mysql command with < in command prompt which is working fine. But could not make it to work in Java. And in the logs there is no error or warning.

Please help me in this.

Regards,
Kiran
 
Bartender
Posts: 1166
17
Netbeans IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have the classic deadlock associated with Runtime.exec() and ProcessBuilder. You are waiting for the process to complete but it can't complete because either the process stdout or stderr buffer becomes full. The process then suspends until there is room in the buffer to place more output but since you do not process either the stdout or stderr to make more room available until the process completes you have a deadlock.

You need to read ALL the sections of http://www.javaworld.com/article/2071275/core-java/when-runtime-exec---won-t.html and implement ALL the recommendations.
 
kopparapu v kiran kumar
Ranch Hand
Posts: 32
MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Rechard,

Thanks for the inputs. Now it is working like Charm.

Regards,
Kiran
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic