Author: mircea.markus
Date: 2010-02-15 10:02:48 -0500 (Mon, 15 Feb 2010)
New Revision: 8336
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
Log:
applied patch from
https://jira.jboss.org/jira/browse/JBCACHE-1569
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoader.java 2010-02-12
07:40:02 UTC (rev 8335)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoader.java 2010-02-15
15:02:48 UTC (rev 8336)
@@ -188,9 +188,9 @@
ResultSet rs = null;
try
{
+ lock.acquireLock(fqn, false);
con = cf.getConnection();
ps = prepareAndLogStatement(con, config.getSelectChildNamesSql(),
fqn.toString());
- lock.acquireLock(fqn, false);
rs = ps.executeQuery();
if (rs.next())
{
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2010-02-12
07:40:02 UTC (rev 8335)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2010-02-15
15:02:48 UTC (rev 8336)
@@ -246,13 +246,13 @@
PreparedStatement ps = null;
try
{
+ lock.acquireLock(fqn, true);
conn = cf.getConnection();
String fqnString = fqn.toString();
//apend / at the end avoids this issue: 'a/b/cd' is not a child of
'a/b/c'
String fqnWildcardString = getFqnWildcardString(fqnString, fqn);
ps = prepareAndLogStatement(conn, config.getDeleteNodeSql(), fqnString,
fqnWildcardString);
- lock.acquireLock(fqn, true);
ps.executeUpdate();
}
catch (SQLException e)