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
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
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.
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.
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.