mirror of https://github.com/apache/openjpa.git
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:
parent
110e3ff4b0
commit
ddc42e8078
|
@ -531,11 +531,19 @@ public class DB2Dictionary
|
|||
|
||||
String Warn = new String((char[]) getSqlWarnMethd.
|
||||
invoke(sqlca, new Object[]{}));
|
||||
if(Warn.trim().length() != 0)
|
||||
if (Warn.trim().length() != 0)
|
||||
exceptionMsg = exceptionMsg.concat(", Warn=" +Warn + "]" );
|
||||
else
|
||||
exceptionMsg = exceptionMsg.concat( "]" );
|
||||
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;
|
||||
} catch (Throwable t) {
|
||||
return sqle.getMessage();
|
||||
|
|
Loading…
Reference in New Issue