From 111098f1b3af2a8cb65618a78eb1bc9b53d6bddb Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Mon, 10 Dec 2007 20:13:20 +0000 Subject: [PATCH] Shows the failed SQL Statement when things break rather than internal ExpContext object git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@603031 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java index 50bb22ad0..969549a10 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java @@ -501,13 +501,14 @@ public class JDBCStoreQuery try { stmnt = sql[i].prepareStatement(conn); count += stmnt.executeUpdate(); + } catch (SQLException se) { + throw SQLExceptions.getStore(se, sql[i].getSQL(), + _store.getDBDictionary()); } finally { if (stmnt != null) try { stmnt.close(); } catch (SQLException se) {} } } - } catch (SQLException se) { - throw SQLExceptions.getStore(se, ctx, _store.getDBDictionary()); } finally { try { conn.close(); } catch (SQLException se) {} }