Fwd: Patch for clear JDBC cache

"Al Forbes" <[email protected]>
Newsgroups gmane.comp.jakarta.turbine.jcs.devel
Message-ID <[email protected]>
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 <[email protected]>
Date: 05-Mar-2007 11:34
Subject: Patch for clear JDBC cache
To: JCS Developers List <[email protected]>


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;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.