OPENJPA-631 provide detailed SQLException for batched statements that encountered error in DB2

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@666137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Catalina Wei 2008-06-10 14:45:59 +00:00
parent 110e3ff4b0
commit ddc42e8078
1 changed files with 9 additions and 1 deletions

View File

@ -536,6 +536,14 @@ public class DB2Dictionary
else else
exceptionMsg = exceptionMsg.concat( "]" ); exceptionMsg = exceptionMsg.concat( "]" );
msg = msg.concat(exceptionMsg); msg = msg.concat(exceptionMsg);
// for batched execution failures, SQLExceptions are nested
SQLException sqle2 = sqle.getNextException();
while (sqle2 != null) {
msg = msg.concat("\n" + sqle2.getMessage());
sqle2 = sqle2.getNextException();
}
return msg; return msg;
} catch (Throwable t) { } catch (Throwable t) {
return sqle.getMessage(); return sqle.getMessage();