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
This commit is contained in:
Pinaki Poddar 2012-06-26 20:27:44 +00:00
parent 4659638a1d
commit f3e64797b2
1 changed files with 2 additions and 2 deletions

View File

@ -164,9 +164,9 @@ public class DistributedConnection implements Connection {
public PreparedStatement prepareStatement(String arg0) throws SQLException { public PreparedStatement prepareStatement(String arg0) throws SQLException {
// TODO: Big hack // TODO: Big hack
if (arg0.startsWith( if (arg0.indexOf("OPENJPA_SEQUENCE_TABLE") != -1) {
"SELECT SEQUENCE_VALUE FROM OPENJPA_SEQUENCE_TABLE"))
return master.prepareStatement(arg0); return master.prepareStatement(arg0);
}
DistributedPreparedStatement ret = new DistributedPreparedStatement(this); DistributedPreparedStatement ret = new DistributedPreparedStatement(this);
for (Connection c : real) { for (Connection c : real) {
ret.add(c.prepareStatement(arg0)); ret.add(c.prepareStatement(arg0));