0

I have a java/mysql application. I am writing huge data to mysql using my java application. But in some cases due to Disk full condition, mysql is crashing. Is it possible to handle mysql diskfull scenario from java/jdbc?

regards

1
  • Please post a) The error you get from JDBC b) What you were trying to do when the disc became full c) All errors in the mysql server error log. What engine you're using may be helpful too. MySQL should not crash when the disc becomes full (but its behaviour, in my experience, is not always helpful) Commented Dec 26, 2011 at 23:06

3 Answers 3

2

It checks once every minute to see whether there is enough space to write the current row. If there is enough space, it continues as if nothing had happened.

Every 10 minutes it writes an entry to the log file, warning about the disk-full condition.

Refer below link :

http://dev.mysql.com/doc/refman/5.0/en/full-disk.html

Try to handle mysql error code : 28 (for disk full) through your java code.

Sign up to request clarification or add additional context in comments.

Comments

0

Is it possible to handle mysql diskfull scenario from java/jdbc?

Well yes. This will manifest itself as a failure in a JDBC update statement, which you can presumably detect based on the exception's (MySQL specific) code.

However, once you've caught the exception, I doubt that there is much that you can do to recover. If the disc is full you need human intervention to resolve the problem; e.g. to look for files that can be deleted.

Comments

0

The disk full condition is detected and handled by MySQL, the result is that your INSERT query fails. If you want to handle it in Java, handle the failed INSERT.

1 Comment

I imagine that other SQL statements could fail too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.