You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-dev@jakarta.apache.org by Al Forbes <fo...@googlemail.com> on 2007/03/05 11:34:12 UTC

Patch for clear JDBC cache

Hi,

When clearing a cache with a key ending with a colon, the SQL has the
syntax "xxx = like key". The = causes an SQL syntax error.

svn diff src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
Index: src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
===================================================================
--- src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
 (revision 514637)
+++ src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
 (working copy)
@@ -554,7 +554,7 @@
             {
                 // remove all keys of the same name group.
                 sql = "delete from " +
getJdbcDiskCacheAttributes().getTableName() + " where REGION = '"
-                    + this.getCacheName() + "' and CACHE_KEY = like
'" + key + "%'";
+                   + this.getCacheName() + "' and CACHE_KEY like '" +
key + "%'";
             }
             Connection con = poolAccess.getConnection();
             Statement sStatement = null;

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


Re: Fwd: Patch for clear JDBC cache

Posted by Michael Stevens <ms...@etla.org>.
On Mon, Mar 12, 2007 at 11:41:12AM +0100, Al Forbes wrote:
> What is the best way for handling patches? Should I open a Jira issue,
> and attach a patch?

I've previously been told this is the way to go.

Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org


Fwd: Patch for clear JDBC cache

Posted by Al Forbes <fo...@googlemail.com>.
What is the best way for handling patches? Should I open a Jira issue,
and attach a patch?

Regards
Al

---------- Forwarded message ----------
From: Al Forbes <fo...@googlemail.com>
Date: 05-Mar-2007 11:34
Subject: Patch for clear JDBC cache
To: JCS Developers List <jc...@jakarta.apache.org>


Hi,

When clearing a cache with a key ending with a colon, the SQL has the
syntax "xxx = like key". The = causes an SQL syntax error.

svn diff src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
Index: src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
===================================================================
--- src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
 (revision 514637)
+++ src/java/org/apache/jcs/auxiliary/disk/jdbc/JDBCDiskCache.java
 (working copy)
@@ -554,7 +554,7 @@
             {
                 // remove all keys of the same name group.
                 sql = "delete from " +
getJdbcDiskCacheAttributes().getTableName() + " where REGION = '"
-                    + this.getCacheName() + "' and CACHE_KEY = like
'" + key + "%'";
+                   + this.getCacheName() + "' and CACHE_KEY like '" +
key + "%'";
             }
             Connection con = poolAccess.getConnection();
             Statement sStatement = null;

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-dev-help@jakarta.apache.org