openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r581083 - /openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Date Mon, 01 Oct 2007 21:44:59 GMT
Author: fancy
Date: Mon Oct  1 14:44:59 2007
New Revision: 581083

URL: http://svn.apache.org/viewvc?rev=581083&view=rev
Log:
OPENJPA-389 et.commit() not issuing database commit for Native queries involving updates.

Modified:
    openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java

Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=581083&r1=581082&r2=581083&view=diff
==============================================================================
--- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
(original)
+++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java
Mon Oct  1 14:44:59 2007
@@ -215,6 +215,9 @@
                 paramList = Collections.EMPTY_LIST;
 
             SQLBuffer buf = new SQLBuffer(dict).append(sql);
+            
+            // we need to make sure we have an active store connection
+            store.getContext().beginStore();
             Connection conn = store.getConnection();
             JDBCFetchConfiguration fetch = (JDBCFetchConfiguration)
                 q.getContext().getFetchConfiguration();
@@ -241,6 +244,8 @@
                     try { stmnt.close(); } catch (SQLException se2) {}
                 try { conn.close(); } catch (SQLException se2) {}
                 throw SQLExceptions.getStore(se, dict);
+            } finally {
+                try { conn.close(); } catch (SQLException se) {}
             }
         }
 



Mime
View raw message