From f3e64797b24b92a012ed80c341d9b4385bdc1629 Mon Sep 17 00:00:00 2001 From: Pinaki Poddar Date: Tue, 26 Jun 2012 20:27:44 +0000 Subject: [PATCH] Check not only select but update as well git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1354210 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/slice/jdbc/DistributedConnection.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java b/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java index 51de6962a..5334eb08b 100644 --- a/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java +++ b/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedConnection.java @@ -164,9 +164,9 @@ public class DistributedConnection implements Connection { public PreparedStatement prepareStatement(String arg0) throws SQLException { // TODO: Big hack - if (arg0.startsWith( - "SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE")) + if (arg0.indexOf("OPENJPA_SEQUENCE_TABLE") != -1) { return master.prepareStatement(arg0); + } DistributedPreparedStatement ret = new DistributedPreparedStatement(this); for (Connection c : real) { ret.add(c.prepareStatement(arg0));