Index: metastore/src/java/org/apache/hadoop/hive/metastore/RetryingRawStore.java =================================================================== --- metastore/src/java/org/apache/hadoop/hive/metastore/RetryingRawStore.java (revision 1352775) +++ metastore/src/java/org/apache/hadoop/hive/metastore/RetryingRawStore.java (working copy) @@ -115,7 +115,14 @@ } catch (UndeclaredThrowableException e) { throw e.getCause(); } catch (InvocationTargetException e) { - throw e.getCause(); + if (e.getCause() instanceof javax.jdo.JDOException) { + // Due to reflection, the jdo exception is wrapped in + // invocationTargetException + caughtException = e; + } + else { + throw e.getCause(); + } } if (retryCount >= retryLimit) {