JBoss Cache SVN: r4908 - cache-bench-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-12-21 00:13:55 -0500 (Fri, 21 Dec 2007)
New Revision: 4908
Modified:
cache-bench-fwk/trunk/runNode.sh
Log:
dummy commit
Modified: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh 2007-12-21 05:12:48 UTC (rev 4907)
+++ cache-bench-fwk/trunk/runNode.sh 2007-12-21 05:13:55 UTC (rev 4908)
@@ -1,7 +1,7 @@
#!/bin/bash
# author: Mircea.Markus(a)jboss.com
# cygwin users: add the scripts from :pserver:anoncvs@cygwin.com:/cvs/cygwin-apps/wrappers/java to the cygwin_home/usr/local/bin
-# those would make an automatic conversion from unix CLASSPATH to win classpath, needed when executing java -cp
+# those would make an automatic conversion from unix CLASSPATH to win classpath, needed when executing java -cp
BIND_ADDRESS=127.0.0.1
CACHE_DEBUG=true
17 years, 1 month
JBoss Cache SVN: r4907 - cache-bench-fwk/trunk.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-12-21 00:12:48 -0500 (Fri, 21 Dec 2007)
New Revision: 4907
Modified:
cache-bench-fwk/trunk/build.xml
Log:
dummy commit
Modified: cache-bench-fwk/trunk/build.xml
===================================================================
--- cache-bench-fwk/trunk/build.xml 2007-12-21 04:58:13 UTC (rev 4906)
+++ cache-bench-fwk/trunk/build.xml 2007-12-21 05:12:48 UTC (rev 4907)
@@ -68,7 +68,7 @@
<patternset refid="ignored.files"/>
</patternset>
- <patternset id="excluded.from.compilation.framework">
+ <patternset id="excluded.from.compilation.framework">
<patternset refid="excluded.from.module.framework"/>
</patternset>
17 years, 1 month
JBoss Cache SVN: r4906 - cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-12-20 23:58:13 -0500 (Thu, 20 Dec 2007)
New Revision: 4906
Modified:
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
Log:
added the wrapper for terracotta 2.5.0
Modified: cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
===================================================================
--- cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java 2007-12-21 04:53:46 UTC (rev 4905)
+++ cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java 2007-12-21 04:58:13 UTC (rev 4906)
@@ -16,7 +16,7 @@
public class TerracottaWrapper implements CacheWrapper
{
// Since terracotta
- private Map cache = new HashMap();
+ private final Map cache = new HashMap();
public void init(Properties parameters) throws Exception
{
17 years, 1 month
JBoss Cache SVN: r4905 - in cache-bench-fwk/trunk: cache-products and 5 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-12-20 23:53:46 -0500 (Thu, 20 Dec 2007)
New Revision: 4905
Added:
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/config.sh
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml
cache-bench-fwk/trunk/runNode.sh
Log:
added the wrapper for terracotta 2.5.0
Added: cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/config.sh
===================================================================
--- cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/config.sh (rev 0)
+++ cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/config.sh 2007-12-21 04:53:46 UTC (rev 4905)
@@ -0,0 +1,9 @@
+#!/bin/bash
+THIS_DIR=./cache-products/terracotta-2.5.0
+TC_HOME="/cygdrive/c/java/terracotta-2.5.0"
+CLASSPATH=$CLASSPATH:./classes/production/terracotta-2.5.0
+SYS_PROPS="$SYS_PROPS -Dtc.config=$THIS_DIR/tc-client-config.xml"
+export START_NODE_COMMAND="$TC_HOME/bin/dso-java.sh -cp $CLASSPATH $SYS_PROPS org.cachebench.CacheBenchmarkRunner"
+
+
+export START_NODE_COMMAND="java -Dtc.install-root=${TC_HOME} -Xbootclasspath/p:${TC_HOME}/lib/dso-boot/dso-boot-hotspot_win32_150_14.jar $SYS_PROPS -cp $CLASSPATH org.cachebench.CacheBenchmarkRunner"
\ No newline at end of file
Added: cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
===================================================================
--- cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java (rev 0)
+++ cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java 2007-12-21 04:53:46 UTC (rev 4905)
@@ -0,0 +1,73 @@
+package org.cachebench.cachewrappers;
+
+import org.cachebench.CacheWrapper;
+
+import java.util.Properties;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * Cache wrapper for Terracotta 2.3.0
+ *
+ * Using the terracotta-cache package on http://www.terracotta.org/confluence/display/labs/Terracotta+Cache
+ *
+ * @author <a href="manik(a)jboss.org">Manik Surtani</a>
+ */
+public class TerracottaWrapper implements CacheWrapper
+{
+ // Since terracotta
+ private Map cache = new HashMap();
+
+ public void init(Properties parameters) throws Exception
+ {
+ }
+
+ public void setUp() throws Exception
+ {
+ }
+
+ public void tearDown() throws Exception
+ {
+ synchronized(cache)
+ {
+ cache.clear();
+ }
+ }
+
+ public void put(Object key, Object value) throws Exception
+ {
+ synchronized(cache)
+ {
+ cache.put(key, value);
+ }
+ }
+
+ public Object get(Object key) throws Exception
+ {
+ synchronized(cache)
+ {
+ return cache.get(key);
+ }
+ }
+
+ public void empty() throws Exception
+ {
+ synchronized(cache)
+ {
+ cache.clear();
+ }
+ }
+
+ public int getNumMembers()
+ {
+ return -1;
+ }
+
+ public String getInfo()
+ {
+ synchronized(cache)
+ {
+ return "There are " + cache.size() + " objects in cache";
+ }
+ }
+}
Added: cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml
===================================================================
--- cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml (rev 0)
+++ cache-bench-fwk/trunk/cache-products/terracotta-2.5.0/tc-client-config.xml 2007-12-21 04:53:46 UTC (rev 4905)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<tc:tc-config xmlns:tc="http://www.terracotta.org/config">
+ <application>
+ <dso>
+ <roots>
+ <root>
+ <field-name>org.cachebench.cachewrappers.TerracottaWrapper.cache</field-name>
+ </root>
+ </roots>
+ <locks>
+ <autolock>
+ <method-expression>* org.cachebench.cachewrappers.TerracottaWrapper*.*(..)</method-expression>
+ <lock-level>write</lock-level>
+ </autolock>
+ </locks>
+ <instrumented-classes>
+ <include><class-expression>org.cachebench.cachewrappers..*</class-expression></include>
+ </instrumented-classes>
+ </dso>
+ </application>
+</tc:tc-config>
+
Added: cache-bench-fwk/trunk/runNode.sh
===================================================================
--- cache-bench-fwk/trunk/runNode.sh (rev 0)
+++ cache-bench-fwk/trunk/runNode.sh 2007-12-21 04:53:46 UTC (rev 4905)
@@ -0,0 +1,42 @@
+#!/bin/bash
+# author: Mircea.Markus(a)jboss.com
+# cygwin users: add the scripts from :pserver:anoncvs@cygwin.com:/cvs/cygwin-apps/wrappers/java to the cygwin_home/usr/local/bin
+# those would make an automatic conversion from unix CLASSPATH to win classpath, needed when executing java -cp
+
+BIND_ADDRESS=127.0.0.1
+CACHE_DEBUG=true
+preferIPv4Stack=true
+
+export SYS_PROPS="-Dbind.address=$BIND_ADDRESS -DcurrentIndex=$1 -Dorg.cachebench.debug=$CACHE_DEBUG -Djava.net.preferIPv4Stack=$preferIPv4Stack"
+
+#libraries needed by the fwk, add them to the classpath
+for JAR in ./lib/*
+do
+ FWK_CLASS_PATH=$FWK_CLASS_PATH:$JAR
+done
+FWK_CLASS_PATH=$FWK_CLASS_PATH:./conf:./classes/production/Framework
+export FWK_CLASS_PATH
+
+CLASSPATH=$FWK_CLASS_PATH:$CLASSPATH
+
+configFile=./cache-products/$2/config.sh
+
+#first check whether the config file exists and load it
+if [ -f $configFile ]
+then
+ . $configFile
+else
+ echo could not find config file $configFile, exit!
+ exit 1
+fi
+
+if [ -n "$START_NODE_COMMAND" ]
+then
+ echo executing command $START_NODE_COMMAND
+ $START_NODE_COMMAND
+else
+ TO_EXECUTE="java -cp $CLASSPATH $SYS_PROPS org.cachebench.CacheBenchmarkRunner $3"
+ echo executing $TO_EXECUTE
+ java -cp $CLASSPATH $SYS_PROPS org.cachebench.CacheBenchmarkRunner $3
+fi
+
17 years, 1 month
JBoss Cache SVN: r4904 - in cache-bench-fwk/trunk: conf and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2007-12-20 23:51:57 -0500 (Thu, 20 Dec 2007)
New Revision: 4904
Modified:
cache-bench-fwk/trunk/build.xml
cache-bench-fwk/trunk/conf/cachebench.xml
cache-bench-fwk/trunk/src/org/cachebench/cluster/ClusterBarrier.java
cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java
Log:
Modified: cache-bench-fwk/trunk/build.xml
===================================================================
--- cache-bench-fwk/trunk/build.xml 2007-12-21 03:02:19 UTC (rev 4903)
+++ cache-bench-fwk/trunk/build.xml 2007-12-21 04:51:57 UTC (rev 4904)
@@ -80,7 +80,7 @@
<target name="help" description="Dumps usage information">
<echo>
-This script has 2 purposes: to build AND run the CacheBenchFwk.
+This script has the purpose of building the CacheBenchFwk.
See /docs/ for more details.
Some useful targets:
@@ -286,7 +286,7 @@
<delete dir="${coherence322-plugin.testoutput.dir}"/>
</target>
- <!-- Module terracotta-2.4.8 -->
+ <!-- Module terracotta-2.5.0 -->
<dirname property="module.terracotta-plugin.basedir" file="${ant.file}"/>
@@ -294,18 +294,17 @@
<property name="compiler.args.terracotta-plugin" value="${compiler.args}"/>
- <property name="terracotta-plugin.output.dir" value="${module.terracotta-plugin.basedir}/classes/production/terracotta-2.4.8"/>
- <property name="terracotta-plugin.testoutput.dir" value="${module.terracotta-plugin.basedir}/classes/test/terracotta-2.4.8"/>
+ <property name="terracotta-plugin.output.dir" value="${module.terracotta-plugin.basedir}/classes/production/terracotta-2.5.0"/>
+ <property name="terracotta-plugin.testoutput.dir" value="${module.terracotta-plugin.basedir}/classes/test/terracotta-2.5.0"/>
<path id="terracotta-plugin.module.bootclasspath">
<!-- Paths to be included in compilation bootclasspath -->
</path>
<path id="terracotta-plugin.module.classpath">
- <pathelement location="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.4.8/conf"/>
+ <pathelement location="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.5.0/conf"/>
<pathelement location="${framework.output.dir}"/>
<pathelement location="${framework.testoutput.dir}"/>
- <fileset dir="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.4.8/lib" includes="*.jar" />
<pathelement location="${terracotta-plugin.output.dir}" />
</path>
@@ -319,15 +318,15 @@
</patternset>
<path id="terracotta-plugin.module.sourcepath">
- <dirset dir="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.4.8">
+ <dirset dir="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.5.0">
<include name="src"/>
</dirset>
</path>
- <target name="compile.module.terracotta-plugin" depends="compile.module.terracotta-plugin.production,compile.module.terracotta-plugin.tests" description="Compile module terracotta-2.4.8"/>
+ <target name="compile.module.terracotta-plugin" depends="compile.module.terracotta-plugin.production,compile.module.terracotta-plugin.tests" description="Compile module terracotta-2.5.0"/>
- <target name="compile.module.terracotta-plugin.production" depends="compile.module.framework" description="Compile module terracotta-2.4.8; production classes">
+ <target name="compile.module.terracotta-plugin.production" depends="compile.module.framework" description="Compile module terracotta-2.5.0; production classes">
<mkdir dir="${terracotta-plugin.output.dir}"/>
<javac destdir="${terracotta-plugin.output.dir}" debug="${compiler.debug}" nowarn="${compiler.generate.no.warnings}" memorymaximumsize="${compiler.max.memory}" fork="true">
<compilerarg line="${compiler.args.terracotta-plugin}"/>
@@ -338,14 +337,14 @@
</javac>
<copy todir="${terracotta-plugin.output.dir}">
- <fileset dir="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.4.8/src">
+ <fileset dir="${module.terracotta-plugin.basedir}/cache-products/terracotta-2.5.0/src">
<patternset refid="compiler.resources"/>
<type type="file"/>
</fileset>
</copy>
</target>
- <target name="compile.module.terracotta-plugin.tests" depends="compile.module.terracotta-plugin.production" description="compile module terracotta-2.4.8; test classes" unless="skip.tests"/>
+ <target name="compile.module.terracotta-plugin.tests" depends="compile.module.terracotta-plugin.production" description="compile module terracotta-2.5.0; test classes" unless="skip.tests"/>
<target name="clean.module.terracotta-plugin" description="cleanup module">
<delete dir="${terracotta-plugin.output.dir}"/>
@@ -494,72 +493,15 @@
<target name="all" depends="init, clean, compile.module.framework, compile.module.ehcache124-plugin, compile.module.coherence322-plugin,compile.module.jbosscache140-plugin, compile.module.jbosscache200-plugin, compile.module.terracotta-plugin" description="build all"/>
- <target name="setJBossCache140PluginCPRef" if="org.cachebench.plugins.jbosscache1" description="Sets the classpath ref for this plugin only if enabled via system property">
- <property name="plugin.classpath.ref" value="jbosscache140-plugin.module.classpath" />
- </target>
-
- <target name="setJBossCache200PluginCPRef" if="org.cachebench.plugins.jbosscache2" description="Sets the classpath ref for this plugin only if enabled via system property">
- <property name="plugin.classpath.ref" value="jbosscache200-plugin.module.classpath" />
- </target>
-
- <target name="setEHCache124PluginCPRef" if="org.cachebench.plugins.ehcache" description="Sets the classpath ref for this plugin only if enabled via system property">
- <property name="plugin.classpath.ref" value="ehcache124-plugin.module.classpath" />
- </target>
-
- <target name="setTerracotta230PluginCPRef" if="org.cachebench.plugins.terracotta" description="Sets the classpath ref for this plugin only if enabled via system property">
- <property name="plugin.classpath.ref" value="terracotta-plugin.module.classpath" />
- </target>
-
- <target name="setCoherence322PluginCPRef" if="org.cachebench.plugins.coherence" description="Sets the classpath ref for this plugin only if enabled via system property">
- <property name="plugin.classpath.ref" value="coherence322-plugin.module.classpath" />
- </target>
-
-
- <target name="run" depends="setJBossCache140PluginCPRef, setJBossCache200PluginCPRef, setEHCache124PluginCPRef, setTerracotta230PluginCPRef, setCoherence322PluginCPRef">
- <!-- the classpaths here are a bit arse - you need to MANUALLY specify which plugins to add to the classpath
- to prevent JBoss Cache 1.x and 2.x tripping over each other. -->
-
- <!-- Formats: expects system properties
- org.cachebench.plugins.jbosscache1
- org.cachebench.plugins.jbosscache2
- org.cachebench.pluins.ehcache
- org.cachebench.plugins.terracotta
- org.cachebench.plugins.coherence
- to be set to true if they need to be added to the classpath of the test. -->
-
- <echo>Running class ${runtime.classname} with classpath ref ${plugin.classpath.ref}</echo>
-
- <java classname="${runtime.classname}" fork="${jvm.fork}" maxmemory="${jvm.maxmem}" clonevm="true">
- <!--<bootclasspath>-->
- <!--<pathelement location="./cache-products/terracotta-2.4.8/lib/bootstrap/boot.jar" />-->
- <!--</bootclasspath>-->
- <sysproperty key="bind.address" value="${bind.address}" />
- <sysproperty key="currentIndex" value="${env.NODE_INDEX}" />
- <sysproperty key="tangosol.coherence.localhost" value="${tangosol.coherence.localhost}" />
- <sysproperty key="org.cachebench.debug" value="${org.cachebench.debug}" />
- <sysproperty key="java.net.preferIPv4Stack" value="${java.net.preferIPv4Stack}" />
- <classpath refid="framework.module.classpath" />
- <classpath refid="${plugin.classpath.ref}"/>
- </java>
- </target>
-
- <target name="runNode">
- <antcall target="run">
- <param name="runtime.classname" value="org.cachebench.CacheBenchmarkRunner" />
- </antcall>
- </target>
-
- <target name="checkClusterAddresses" depends="compile.module.framework.production" description="Check whether the cluster config is a valid one">
- <!--<antcall target="run">-->
- <!--<param name="runtime.classname" value="org.cachebench.ClusterConfigurationCheck" />-->
- <!--</antcall>-->
-
+ <target name="checkClusterAddresses" depends="compile.module.framework.production"
+ description="Check whether the cluster config is a valid one">
<java classname="org.cachebench.ClusterConfigurationCheck" clonevm="true" fork="true">
<classpath>
<pathelement location="${framework.output.dir}"/>
<pathelement location="${framework.testoutput.dir}"/>
</classpath>
- <classpath refid="framework.module.classpath" />
+ <classpath refid="framework.module.classpath"/>
</java>
</target>
+
</project>
Modified: cache-bench-fwk/trunk/conf/cachebench.xml
===================================================================
--- cache-bench-fwk/trunk/conf/cachebench.xml 2007-12-21 03:02:19 UTC (rev 4903)
+++ cache-bench-fwk/trunk/conf/cachebench.xml 2007-12-21 04:51:57 UTC (rev 4904)
@@ -47,7 +47,7 @@
<!--<testcase name="JBossCache2x-Pessimistic-REPL_SYNC_BR" cacheWrapper="org.cachebench.cachewrappers.JBossCache200Wrapper">-->
<!--<testcase name="JBossCache2x-Pessimistic-REPL_ASYNC" cacheWrapper="org.cachebench.cachewrappers.JBossCache200Wrapper">-->
- <testcase name="JBossCache2.0" cacheWrapper="org.cachebench.cachewrappers.JBossCache200Wrapper">
+ <testcase name="JBossCache2.0" cacheWrapper="org.cachebench.cachewrappers.TerracottaWrapper">
<!-- warms up the cache by doing operation on it; simulates a real-world environment. If no warmup is needed use
Modified: cache-bench-fwk/trunk/src/org/cachebench/cluster/ClusterBarrier.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/cluster/ClusterBarrier.java 2007-12-21 03:02:19 UTC (rev 4903)
+++ cache-bench-fwk/trunk/src/org/cachebench/cluster/ClusterBarrier.java 2007-12-21 04:51:57 UTC (rev 4904)
@@ -126,7 +126,7 @@
{
if (!acknowledge)
{
- return message;
+ return payload;
}
String payloadStr = payload.toString();
int endIndex = payloadStr.length() - ACK.length();
Modified: cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java
===================================================================
--- cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java 2007-12-21 03:02:19 UTC (rev 4903)
+++ cache-bench-fwk/trunk/src/org/cachebench/tests/SimpleTest.java 2007-12-21 04:51:57 UTC (rev 4904)
@@ -35,7 +35,7 @@
executor = Executors.newFixedThreadPool(numThreads);
TestResult result = new TestResult();
- result.setTestName(testCaseName);
+ result.setTestName(testCaseName + getNodeIndex());
result.setTestTime(new Date());
result.setTestType(testName);
@@ -267,4 +267,14 @@
}
return 0;
}
+
+ public String getNodeIndex()
+ {
+ try
+ {
+ return " - " + Integer.parseInt(System.getProperty("currentIndex"));
+ } catch (Exception e) {
+ return "";
+ }
+ }
}
17 years, 1 month
JBoss Cache SVN: r4903 - in core/support-branches/1.4.1.SP8_JBCACHE-1247: tests/functional/org/jboss/cache/options and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2007-12-20 22:02:19 -0500 (Thu, 20 Dec 2007)
New Revision: 4903
Modified:
core/support-branches/1.4.1.SP8_JBCACHE-1247/src/org/jboss/cache/interceptors/TxInterceptor.java
core/support-branches/1.4.1.SP8_JBCACHE-1247/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java
Log:
[JBCACHE-1246] Only remove fail-silently txs where we haven't registered a synchronization
Modified: core/support-branches/1.4.1.SP8_JBCACHE-1247/src/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/support-branches/1.4.1.SP8_JBCACHE-1247/src/org/jboss/cache/interceptors/TxInterceptor.java 2007-12-21 00:31:34 UTC (rev 4902)
+++ core/support-branches/1.4.1.SP8_JBCACHE-1247/src/org/jboss/cache/interceptors/TxInterceptor.java 2007-12-21 03:02:19 UTC (rev 4903)
@@ -92,11 +92,18 @@
if (optionOverride!= null && optionOverride.isFailSilently() && ctx.getTransaction() != null)
{
- // make sure we remove the tx and global tx from the transaction table, since we don't care about this transaction
- // and will just suspend it. - JBCACHE-1246
- GlobalTransaction gtx = txTable.remove(ctx.getTransaction());
- if (gtx != null) txTable.remove(gtx);
-
+ // JBCACHE-1246 If we haven't previously registered a synchronization
+ // for the current tx, remove it from the tx table, since we are about to
+ // suspend it and thus won't remove it later via the synchronization.
+ // If we don't do this, we leak the tx and gtx in txTable.
+ // BES -- I'm using the transactions map here as a proxy for whether
+ // the tx has had a synchronization registered. Not really ideal...
+ if (transactions.get(ctx.getTransaction()) == null)
+ {
+ GlobalTransaction gtx = txTable.remove(ctx.getTransaction());
+ if (gtx != null) txTable.remove(gtx);
+ }
+
suspendedTransaction = txManager.suspend();
// set the tx in the invocation context to null now! - JBCACHE-785
ctx.setTransaction(null);
Modified: core/support-branches/1.4.1.SP8_JBCACHE-1247/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java
===================================================================
--- core/support-branches/1.4.1.SP8_JBCACHE-1247/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java 2007-12-21 00:31:34 UTC (rev 4902)
+++ core/support-branches/1.4.1.SP8_JBCACHE-1247/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java 2007-12-21 03:02:19 UTC (rev 4903)
@@ -18,6 +18,7 @@
private TreeCache cache;
private TransactionManager tm;
private Fqn fqn = Fqn.fromString("/a/b/c");
+ private Fqn fqn1 = Fqn.fromString("/c/d/e");
private String key = "key", value = "value";
protected void tearDown()
@@ -46,5 +47,42 @@
int txCnt = cache.getTransactionTable().getNumLocalTransactions();
assertEquals("Global transaction count is > 0", 0, gtxCnt);
assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ cache.put(fqn1, key, value);
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ cache.put(fqn1, key, value);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ cache.put(fqn1, key, value);
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ cache.put(fqn1, key, value);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
}
}
17 years, 1 month
JBoss Cache SVN: r4902 - core/branches/1.4.X/src/org/jboss/cache/aop.
by jbosscache-commits@lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-12-20 19:31:34 -0500 (Thu, 20 Dec 2007)
New Revision: 4902
Modified:
core/branches/1.4.X/src/org/jboss/cache/aop/TreeCacheAopDelegate.java
Log:
Fix PCACHE-58
Modified: core/branches/1.4.X/src/org/jboss/cache/aop/TreeCacheAopDelegate.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/aop/TreeCacheAopDelegate.java 2007-12-20 22:17:08 UTC (rev 4901)
+++ core/branches/1.4.X/src/org/jboss/cache/aop/TreeCacheAopDelegate.java 2007-12-21 00:31:34 UTC (rev 4902)
@@ -587,35 +587,34 @@
protected void _regularRemoveObject(Fqn fqn, boolean removeCacheInterceptor, Object result, Class clazz,
boolean evict) throws CacheException
{
- InstanceAdvisor advisor = ((Advised) result)._getInstanceAdvisor();
+ Advised advised = ((Advised) result);
+ InstanceAdvisor advisor = advised._getInstanceAdvisor();
+ Advisor advisorAdvisor = advised._getAdvisor();
CachedType type = cache_.getCachedType(clazz);
for (Iterator i = type.getFieldsIterator(); i.hasNext();) {
Field field = (Field) i.next();
Object value = null;
- try {
- value=field.get(result);
- }
- catch(IllegalAccessException e) {
- throw new CacheException("field access failed", e);
- }
CachedType fieldType = cache_.getCachedType(field.getType());
- if (!fieldType.isImmediate()) {
- _removeObject(new Fqn(fqn, field.getName()), removeCacheInterceptor, evict);
+ if (fieldType.isImmediate()|| CachedType.hasSerializableAnnotation(field, advisorAdvisor)) {
+ value = cache_.get(fqn, field.getName());
+ } else {
+ value = _removeObject(new Fqn(fqn, field.getName()), removeCacheInterceptor, evict);
}
// Check for Collection field so we need to restore the original reference.
if(value instanceof ClassProxy)
{
Interceptor interceptor = CollectionInterceptorUtil.getInterceptor((ClassProxy)value);
- Object ori = ((AbstractCollectionInterceptor)interceptor).getOriginalInstance();
- try {
- field.set(result, ori);
- } catch (IllegalAccessException e) {
- throw new CacheException("field access failed", e);
- }
+ value = ((AbstractCollectionInterceptor)interceptor).getOriginalInstance();
}
+
+ try {
+ field.set(result, value);
+ } catch (IllegalAccessException e) {
+ throw new CacheException("field access failed", e);
+ }
}
// batch remove
17 years, 1 month
JBoss Cache SVN: r4901 - in core/branches/1.4.X: tests/functional/org/jboss/cache/options and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: bstansberry(a)jboss.com
Date: 2007-12-20 17:17:08 -0500 (Thu, 20 Dec 2007)
New Revision: 4901
Modified:
core/branches/1.4.X/src/org/jboss/cache/interceptors/TxInterceptor.java
core/branches/1.4.X/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java
Log:
[JBCACHE-1246] Only remove fail-silently txs where we haven't registered a synchronization
Modified: core/branches/1.4.X/src/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/interceptors/TxInterceptor.java 2007-12-20 18:17:41 UTC (rev 4900)
+++ core/branches/1.4.X/src/org/jboss/cache/interceptors/TxInterceptor.java 2007-12-20 22:17:08 UTC (rev 4901)
@@ -92,11 +92,20 @@
if (optionOverride!= null && optionOverride.isFailSilently() && ctx.getTransaction() != null)
{
- // make sure we remove the tx and global tx from the transaction table, since we don't care about this transaction
- // and will just suspend it. - JBCACHE-1246
- GlobalTransaction gtx = txTable.remove(ctx.getTransaction());
- if (gtx != null) txTable.remove(gtx);
-
+ // JBCACHE-1246 If we haven't previously registered a synchronization
+ // for the current tx, remove it from the tx table, since we are about to
+ // suspend it and thus won't remove it later via the synchronization.
+ // If we don't do this, we leak the tx and gtx in txTable.
+ // BES -- I'm using the transactions map here as a proxy for whether
+ // the tx has had a synchronization registered. Not really ideal...
+ if (transactions.get(ctx.getTransaction()) == null)
+ {
+ // make sure we remove the tx and global tx from the transaction table, since we don't care about this transaction
+ // and will just suspend it. - JBCACHE-1246
+ GlobalTransaction gtx = txTable.remove(ctx.getTransaction());
+ if (gtx != null) txTable.remove(gtx);
+ }
+
suspendedTransaction = txManager.suspend();
// set the tx in the invocation context to null now! - JBCACHE-785
ctx.setTransaction(null);
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java 2007-12-20 18:17:41 UTC (rev 4900)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/options/OptimisticMemLeakTest.java 2007-12-20 22:17:08 UTC (rev 4901)
@@ -18,6 +18,7 @@
private TreeCache cache;
private TransactionManager tm;
private Fqn fqn = Fqn.fromString("/a/b/c");
+ private Fqn fqn1 = Fqn.fromString("/c/d/e");
private String key = "key", value = "value";
protected void tearDown()
@@ -46,5 +47,42 @@
int txCnt = cache.getTransactionTable().getNumLocalTransactions();
assertEquals("Global transaction count is > 0", 0, gtxCnt);
assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ cache.put(fqn1, key, value);
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ cache.put(fqn1, key, value);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
+
+ tm.begin();
+ cache.put(fqn1, key, value);
+ option = new Option();
+ option.setFailSilently(true);
+ cache.put(fqn, key, value, option);
+ cache.put(fqn1, key, value);
+ tm.commit();
+
+ gtxCnt = cache.getTransactionTable().getNumGlobalTransactions();
+ txCnt = cache.getTransactionTable().getNumLocalTransactions();
+ assertEquals("Global transaction count is > 0", 0, gtxCnt);
+ assertEquals("Local transaction count is > 0", 0, txCnt);
}
}
17 years, 1 month
JBoss Cache SVN: r4900 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-20 13:17:41 -0500 (Thu, 20 Dec 2007)
New Revision: 4900
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
Log:
fixed skipping of read methods as well if suppress locking is true
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-12-20 18:03:29 UTC (rev 4899)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/PessimisticLockInterceptor.java 2007-12-20 18:17:41 UTC (rev 4900)
@@ -19,6 +19,7 @@
import org.jboss.cache.lock.LockingException;
import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.lock.TimeoutException;
+import org.jboss.cache.marshall.MethodDeclarations;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
import org.jboss.cache.transaction.TransactionTable;
@@ -113,6 +114,11 @@
return nextInterceptor(ctx);
}
+ protected boolean skipMethodCall(InvocationContext ctx)
+ {
+ return (ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isSuppressLocking() && !MethodDeclarations.isPutMethod(ctx.getMethodCall().getMethodId()));
+ }
+
protected Object handleLockMethod(InvocationContext ctx, Fqn fqn, NodeLock.LockType lockType, boolean recursive) throws Throwable
{
acquireLocksWithTimeout(ctx, fqn, lockType, false, false, false, false);
17 years, 1 month
JBoss Cache SVN: r4899 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2007-12-20 13:03:29 -0500 (Thu, 20 Dec 2007)
New Revision: 4899
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
Log:
fail sitently option fix
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2007-12-20 17:14:25 UTC (rev 4898)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2007-12-20 18:03:29 UTC (rev 4899)
@@ -6,12 +6,12 @@
*/
package org.jboss.cache.interceptors;
+import org.apache.commons.logging.Log;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.config.Option;
import org.jboss.cache.marshall.MethodCall;
import org.jboss.cache.marshall.MethodDeclarations;
import org.jboss.cache.transaction.GlobalTransaction;
-import org.apache.commons.logging.Log;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
@@ -65,7 +65,15 @@
}
}
- Object retval = nextInterceptor(ctx);
+ Object retval;
+ try
+ {
+ retval = nextInterceptor(ctx);
+ }
+ catch (Throwable th)
+ {
+ retval = th;
+ }
// assume we're the first interceptor in the chain. Handle the exception-throwing.
if (retval instanceof Throwable)
{
17 years, 1 month