Revision: 233
http://polepos.svn.sourceforge.net/polepos/?rev=233&view=rev
Author: carlrosenberger
Date: 2011-12-12 12:45:40 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
cr: VOD JPA is now running too. Changes to the rendering of the results. A long bar now always indicates a better result.
Modified Paths:
--------------
trunk/polepos/.classpath
trunk/polepos/build.xml
trunk/polepos/settings/Jdo.properties
trunk/polepos/settings/Jpa.properties
trunk/polepos/src/META-INF/persistence.xml
trunk/polepos/src/org/polepos/RunSeason.java
trunk/polepos/src/org/polepos/enhance/AllEnhance.java
trunk/polepos/src/org/polepos/enhance/VodEnhancer.java
trunk/polepos/src/org/polepos/framework/VersionClassLoader.java
trunk/polepos/src/org/polepos/reporters/CustomBarPDFReporter.java
trunk/polepos/src/org/polepos/reporters/CustomBarRendererBase.java
trunk/polepos/src/org/polepos/reporters/Graph.java
trunk/polepos/src/org/polepos/reporters/PersistGraphReporter.java
trunk/polepos/src/org/polepos/runner/db4o/AbstractDb4oVersionsRaceRunner.java
trunk/polepos/src/org/polepos/teams/hibernate/HibernateTeam.java
trunk/polepos/src/org/polepos/teams/jdo/JdoCar.java
trunk/polepos/src/org/polepos/teams/jdo/JdoTeam.java
trunk/polepos/src/org/polepos/teams/jpa/JpaTeam.java
trunk/polepos/src/org/polepos/teams/jpa/data/ComplexHolder2.java
trunk/polepos/src/org/polepos/teams/jpa/data/InheritanceHierarchy2.java
trunk/polepos/src/org/polepos/teams/jpa/data/JPB2.java
trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedObject.java
trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedPilot.java
trunk/polepos/src/org/polepos/teams/jpa/data/JpaListHolder.java
Added Paths:
-----------
trunk/polepos/lib/common/ant.jar
trunk/polepos/lib/jpa/javax.persistence_2.0.0.jar
trunk/polepos/lib/vod/antlr-3.3-complete.jar
trunk/polepos/lib/vod/asm-all-4.0_RC1.jar
trunk/polepos/lib/vod/jpa-agent.jar
trunk/polepos/lib/vod/vodjpa.jar
trunk/polepos/src/org/polepos/enhance/VodJpaEnhance.java
trunk/polepos/src/org/polepos/reporters/RendererFactory.java
trunk/polepos/src/org/polepos/teams/TeamFactory.java
trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeam.java
trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeamFactory.java
trunk/polepos/src/org/polepos/teams/jpa/VodJpaCar.java
trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeam.java
trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeamFactory.java
Removed Paths:
-------------
trunk/polepos/lib/jpa/geronimo-jpa_2.0_spec-1.1.jar
Modified: trunk/polepos/.classpath
===================================================================
--- trunk/polepos/.classpath 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/.classpath 2011-12-12 12:45:40 UTC (rev 233)
@@ -20,7 +20,6 @@
<classpathentry kind="lib" path="lib/slf4j/slf4j-log4j12-1.5.10.jar"/>
<classpathentry kind="lib" path="lib/vod/jvi80.jar"/>
<classpathentry kind="lib" path="lib/vod/pizza.jar"/>
- <classpathentry kind="lib" path="lib/vod/vodjdo.jar"/>
<classpathentry kind="lib" path="lib/hsqldb/hsqldb.jar"/>
<classpathentry kind="lib" path="lib/jdo/jdo-api-3.0.jar"/>
<classpathentry kind="lib" path="lib/db4o/db4o-8.0.174.15231-all-java5.jar"/>
@@ -29,6 +28,12 @@
<classpathentry kind="lib" path="lib/graph/jcommon-1.0.16.jar"/>
<classpathentry kind="lib" path="lib/graph/jfreechart-1.0.13.jar" sourcepath="lib/graph/jfreechart-1.0.13-src.zip"/>
<classpathentry kind="lib" path="lib/sqlite/sqlitejdbc-v056.jar"/>
+ <classpathentry kind="lib" path="lib/vod/vodjpa.jar" sourcepath="C:/Users/Carl/crosenbe_JPA/vobs/pmc_java/jpa"/>
+ <classpathentry kind="lib" path="lib/vod/jpa-agent.jar"/>
+ <classpathentry kind="lib" path="lib/jpa/javax.persistence_2.0.0.jar"/>
+ <classpathentry kind="lib" path="lib/vod/antlr-3.3-complete.jar"/>
+ <classpathentry kind="lib" path="lib/vod/asm-all-4.0_RC1.jar"/>
+ <classpathentry kind="lib" path="lib/common/ant.jar"/>
<classpathentry kind="var" path="JUNIT_HOME/junit.jar" sourcepath="/ECLIPSE_HOME/plugins/org.eclipse.jdt.source_3.1.0/src/org.junit_3.8.1/junitsrc.zip"/>
<classpathentry kind="lib" path="lib/graph/gnujaxp.jar"/>
<classpathentry kind="lib" path="lib/graph/itext-1.2.jar"/>
@@ -37,7 +42,6 @@
<classpathentry kind="lib" path="lib/mysql/mysql-connector-java-5.1.16-bin.jar"/>
<classpathentry kind="lib" path="lib/postgresql/postgresql-9.0-801.jdbc4.jar"/>
<classpathentry kind="lib" path="lib/common/ehcache-core-2.2.0.jar"/>
- <classpathentry kind="lib" path="lib/jpa/geronimo-jpa_2.0_spec-1.1.jar"/>
<classpathentry kind="lib" path="lib/jta/geronimo-jta_1.1_spec-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/openjpa/openjpa-2.1.0.jar"/>
<classpathentry kind="lib" path="lib/common/asm-3.3.jar"/>
Modified: trunk/polepos/build.xml
===================================================================
--- trunk/polepos/build.xml 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/build.xml 2011-12-12 12:45:40 UTC (rev 233)
@@ -1,49 +1,72 @@
<project name="poleposition" default="race" basedir=".">
- <property name="polepositionversion" value="0.40"/>
+ <property name="polepositionversion" value="0.50"/>
<property name="polepos.concurrency" value="true"/>
<property name="jdo" value="jdo"/>
- <property name="jvi" value="jvi"/>
- <property name="jpa" value="jpa"/>
-
- <path id="poleposition_classpath">
+ <property name="vodjpa" value="vodjpa"/>
+<!--
+ <property name="jpa" value="jpa"/>
+ <property name="jvi" value="jvi"/>
+-->
+
+ <path id="compilation_classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
+ <exclude name="**/vodjdo.jar" />
</fileset>
<fileset dir="../polepos.monitoring/dist">
<include name="**/*.jar"/>
</fileset>
<pathelement location="bin"/>
</path>
+
+ <path id="runtime_classpath">
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ <exclude name="**/vodjdo.jar" />
+ </fileset>
+ <fileset dir="../polepos.monitoring/dist">
+ <include name="**/*.jar"/>
+ </fileset>
+ <pathelement location="bin"/>
+ </path>
+
<target name="jdoenhance" description="runs the JDO enhancer" if="jdo">
<java classname="org.polepos.enhance.JdoEnhance">
- <classpath refid="poleposition_classpath"/>
+ <classpath refid="compilation_classpath"/>
</java>
</target>
<target name="jpaenhance" description="runs the JPA enhancer" if="jpa">
<java classname="org.polepos.enhance.JpaEnhance">
- <classpath refid="poleposition_classpath"/>
+ <classpath refid="compilation_classpath"/>
</java>
</target>
+
+ <target name="vodjpaenhance" description="runs the VOD JPA enhancer" if="vodjpa">
+ <java classname="org.polepos.enhance.VodJpaEnhance">
+ <classpath refid="compilation_classpath"/>
+ </java>
+ </target>
<target name="jvienhance" description="runs the JVI enhancer" if="jvi">
<java classname="com.versant.Enhance" fork="yes" failonerror="yes">
- <classpath refid="poleposition_classpath"/>
+ <classpath refid="compilation_classpath"/>
<arg line="-config src/config.jvi -in bin -out bin"/>
</java>
</target>
- <target name="race" depends="clean,compile,jpaenhance,jdoenhance"
+ <target name="race" depends="clean,compile,jdoenhance, vodjpaenhance"
description="runs with all circuits and all teams ">
<echo message="${polepos.debug}"/>
- <java classname="org.polepos.RunSeason" fork="true">
- <classpath refid="poleposition_classpath">
+ <java classname="org.polepos.RunSeason" fork="true">
+ <classpath refid="runtime_classpath">
</classpath>
- <jvmarg value="-Xmx1024m"/>
+ <jvmarg value="-Xmx1400m"/>
+ <jvmarg value="-javaagent:lib/vod/jpa-agent.jar"/>
<sysproperty key="polepos.debug" value="${polepos.debug}"/>
<sysproperty key="polepos.concurrency" value="${polepos.concurrency}"/>
@@ -61,7 +84,7 @@
</copy>
<javac destdir="bin" debug="true">
<src path="src"/>
- <classpath refid="poleposition_classpath"/>
+ <classpath refid="compilation_classpath"/>
</javac>
</target>
Added: trunk/polepos/lib/common/ant.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/common/ant.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: trunk/polepos/lib/jpa/geronimo-jpa_2.0_spec-1.1.jar
===================================================================
(Binary files differ)
Added: trunk/polepos/lib/jpa/javax.persistence_2.0.0.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/jpa/javax.persistence_2.0.0.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/polepos/lib/vod/antlr-3.3-complete.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/vod/antlr-3.3-complete.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/polepos/lib/vod/asm-all-4.0_RC1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/vod/asm-all-4.0_RC1.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/polepos/lib/vod/jpa-agent.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/vod/jpa-agent.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/polepos/lib/vod/vodjpa.jar
===================================================================
(Binary files differ)
Property changes on: trunk/polepos/lib/vod/vodjpa.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/polepos/settings/Jdo.properties
===================================================================
--- trunk/polepos/settings/Jdo.properties 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/settings/Jdo.properties 2011-12-12 12:45:40 UTC (rev 233)
@@ -42,5 +42,5 @@
vod8.vendor=Versant
vod8.name=VOD
vod8.description=Versant Object Database
-vod8.version=8.0.1.6
+vod8.version=8.0.2
vod8.color=0xCF432F
Modified: trunk/polepos/settings/Jpa.properties
===================================================================
--- trunk/polepos/settings/Jpa.properties 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/settings/Jpa.properties 2011-12-12 12:45:40 UTC (rev 233)
@@ -2,15 +2,27 @@
#
# JPA implementations to be run
#
-#
# jpa=datanucleus,openjpa
+jpa=vodjpa
-jpa=openjpa
-
-enhance=true
+enhance=false
enhancer=openjpa
+
#
+# vodjpa
+#
+vodjpa.factory=com.versant.jpa.core.VersantEntityManagerFactoryImpl
+vodjpa.vendor=Versant
+vodjpa.name=VersantJPA
+vodjpa.version=8.0.2
+vodjpa.description=Versant JPA
+vodjpa.website=http://www.versant.com
+vodjpa.color=0x7AC5CD
+vodjpa.connecturl=dbbench@localhost
+
+
+#
# datanucleus
#
datanucleus.factory=org.datanucleus.jpa.jpaPersistenceManagerFactory
Modified: trunk/polepos/src/META-INF/persistence.xml
===================================================================
--- trunk/polepos/src/META-INF/persistence.xml 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/META-INF/persistence.xml 2011-12-12 12:45:40 UTC (rev 233)
@@ -2,7 +2,40 @@
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
+ http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0">
+
+
+ <persistence-unit name="vodjpa">
+ <provider>com.versant.jpa.core.VersantPersistence</provider>
+ <class>org.polepos.teams.jpa.data.ComplexHolder0</class>
+ <class>org.polepos.teams.jpa.data.ComplexHolder1</class>
+ <class>org.polepos.teams.jpa.data.ComplexHolder2</class>
+ <class>org.polepos.teams.jpa.data.ComplexHolder3</class>
+ <class>org.polepos.teams.jpa.data.ComplexHolder4</class>
+ <class>org.polepos.teams.jpa.data.ListHolder</class>
+ <class>org.polepos.teams.jpa.data.InheritanceHierarchy0</class>
+ <class>org.polepos.teams.jpa.data.InheritanceHierarchy1</class>
+ <class>org.polepos.teams.jpa.data.InheritanceHierarchy2</class>
+ <class>org.polepos.teams.jpa.data.InheritanceHierarchy3</class>
+ <class>org.polepos.teams.jpa.data.InheritanceHierarchy4</class>
+ <class>org.polepos.teams.jpa.data.JpaIndexedObject</class>
+ <class>org.polepos.teams.jpa.data.JpaIndexedPilot</class>
+ <class>org.polepos.teams.jpa.data.JpaPilot</class>
+ <class>org.polepos.teams.jpa.data.JpaTree</class>
+ <class>org.polepos.teams.jpa.data.JPB0</class>
+ <class>org.polepos.teams.jpa.data.JPB1</class>
+ <class>org.polepos.teams.jpa.data.JPB2</class>
+ <class>org.polepos.teams.jpa.data.JPB3</class>
+ <class>org.polepos.teams.jpa.data.JPB4</class>
+ <class>org.polepos.teams.jpa.data.JpaLightObject</class>
+ <class>org.polepos.teams.jpa.data.JpaListHolder</class>
+ <class>org.polepos.teams.jpa.data.JPN1</class>
+ <properties>
+ <property name="versant.connectionURL" value="dbbench@localhost" />
+ </properties>
+ </persistence-unit>
+
+
<!--
<persistence-unit name="datanucleus/mysql" transaction-type="RESOURCE_LOCAL">
<provider>org.datanucleus.jpa.PersistenceProviderImpl</provider>
@@ -44,7 +77,7 @@
</properties>
</persistence-unit>
-
+
<persistence-unit name="datanucleus/postgresql" transaction-type="RESOURCE_LOCAL">
<provider>org.datanucleus.jpa.PersistenceProviderImpl</provider>
@@ -87,7 +120,7 @@
</persistence-unit>
-->
-
+<!--
<persistence-unit name="openjpa/mysql">
<provider>org.apache.openjpa.persistence.PersistenceProviderImpl</provider>
@@ -117,8 +150,6 @@
<properties>
- <!-- Set up openjpa with Apache DBCP connection pooling -->
-
<property name="openjpa.ConnectionProperties"
value="DriverClassName=com.mysql.jdbc.Driver,
Url=jdbc:mysql://localhost/dbbench,
@@ -136,6 +167,7 @@
</properties>
</persistence-unit>
+-->
<!--
<persistence-unit name="openjpa/postgresql">
Modified: trunk/polepos/src/org/polepos/RunSeason.java
===================================================================
--- trunk/polepos/src/org/polepos/RunSeason.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/RunSeason.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -61,7 +61,7 @@
@Override
public Circuit[] circuits() {
- return ArraysP.concat(defaultCircuits(), concurrencyCircuits());
+ return ArraysP.concat(concurrencyCircuits(), defaultCircuits());
}
private Circuit[] defaultCircuits(){
@@ -92,12 +92,17 @@
@Override
public Team[] teams() {
return new Team[] {
- new Db4oTeam(),
- new JdoTeam(),
-// new Db4oClientServerTeam(),
+ VodJdoTeamFactory.newVodJdoTeam(),
+ VodJpaTeamFactory.newVodJpaTeam(),
+// new JdoTeam(),
+// new JpaTeam(true),
+// new Db4oTeam(),
+
+ new Db4oClientServerTeam(),
new JdbcTeam(),
new HibernateTeam(),
- new JpaTeam(),
+
+// new JpaTeam(),
// new MongoDBTeam(),
// new JviTeam(),
};
@@ -107,5 +112,6 @@
protected Reporter[] reporters() {
return DefaultReporterFactory.defaultReporters();
}
+
}
Modified: trunk/polepos/src/org/polepos/enhance/AllEnhance.java
===================================================================
--- trunk/polepos/src/org/polepos/enhance/AllEnhance.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/enhance/AllEnhance.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -29,7 +29,9 @@
// new JviEnhance().runWithoutSystemExit();
- JpaEnhance.main(null);
+ VodJpaEnhance.main(null);
+
+ // JpaEnhance.main(null);
}
}
Modified: trunk/polepos/src/org/polepos/enhance/VodEnhancer.java
===================================================================
--- trunk/polepos/src/org/polepos/enhance/VodEnhancer.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/enhance/VodEnhancer.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -4,21 +4,21 @@
import java.io.*;
-import com.versant.core.jdo.tools.enhancer.*;
+// import com.versant.core.jdo.tools.enhancer.*;
public class VodEnhancer {
public static void main(String[] args) throws Exception {
- String propertiesFilePath = "settings/versant.properties";
- String outputDir = "bin";
-
- Enhancer enhancer = new Enhancer();
- enhancer.setPropertiesFile(new File(propertiesFilePath));
-
- System.out.println("Enhancing to: " + new File(outputDir).getAbsolutePath());
-
- enhancer.setOutputDir(new File(outputDir));
- enhancer.enhance();
+// String propertiesFilePath = "settings/versant.properties";
+// String outputDir = "bin";
+//
+// Enhancer enhancer = new Enhancer();
+// enhancer.setPropertiesFile(new File(propertiesFilePath));
+//
+// System.out.println("Enhancing to: " + new File(outputDir).getAbsolutePath());
+//
+// enhancer.setOutputDir(new File(outputDir));
+// enhancer.enhance();
}
}
Added: trunk/polepos/src/org/polepos/enhance/VodJpaEnhance.java
===================================================================
--- trunk/polepos/src/org/polepos/enhance/VodJpaEnhance.java (rev 0)
+++ trunk/polepos/src/org/polepos/enhance/VodJpaEnhance.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,46 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.enhance;
+
+import java.io.*;
+
+import org.apache.tools.ant.*;
+import org.apache.tools.ant.types.*;
+
+import com.versant.jpa.enhancer.ant.*;
+
+public class VodJpaEnhance {
+
+ public static void main(String[] args) {
+ Project project = new Project();
+ EnhancerTask enhancerTask = new EnhancerTask();
+ enhancerTask.setProject(project);
+ enhancerTask.setInheritsClasspath(true);
+ enhancerTask.setDestdir("bin");
+ FileSet fs = new FileSet();
+ fs.setProject(project);
+ fs.setDir(new File("bin"));
+ fs.createInclude().setName("**/*.class");
+ enhancerTask.addFileSet(fs);
+ enhancerTask.execute();
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/enhance/VodJpaEnhance.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/framework/VersionClassLoader.java
===================================================================
--- trunk/polepos/src/org/polepos/framework/VersionClassLoader.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/framework/VersionClassLoader.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -49,6 +49,7 @@
protected Class<?> loadClass(String name,boolean resolve) throws ClassNotFoundException {
try {
+ // System.out.println(name + " ... loaded from VersionClassLoader");
if(cache.containsKey(name)) {
return cache.get(name);
}
Modified: trunk/polepos/src/org/polepos/reporters/CustomBarPDFReporter.java
===================================================================
--- trunk/polepos/src/org/polepos/reporters/CustomBarPDFReporter.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/reporters/CustomBarPDFReporter.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -71,7 +71,7 @@
pdfData().add(render(graph, new OneArgFunction<Graph, ChartRenderer>() {
@Override
public ChartRenderer invoke(Graph graph) {
- return newRenderer(graph);
+ return RendererFactory.newRenderer(graph);
}
}));
@@ -113,18 +113,6 @@
return new ImgTemplate(tp);
}
- private CustomBarRendererBase newRenderer(Graph graph) {
- if (graph.circuit().isFixedTime()) {
- if (Settings.LOGARITHMIC) {
- return new LogarithmicFixedTimeCustomBarRenderer(graph);
- }
- return new LinearFixedTimeCustomBarRenderer(graph);
- }
- if (Settings.LOGARITHMIC) {
- return new LogarithmicTimedLapsCustomBarRenderer(graph);
- }
- return new LinearTimedLapsCustomBarRenderer(graph);
- }
@Override
protected void renderTableAndGraph(int type, Graph graph, String unitsLegend) throws BadElementException {
Modified: trunk/polepos/src/org/polepos/reporters/CustomBarRendererBase.java
===================================================================
--- trunk/polepos/src/org/polepos/reporters/CustomBarRendererBase.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/reporters/CustomBarRendererBase.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -97,16 +97,14 @@
int circuitNo = 5;
ObjectSet<Graph> result = db.query(Graph.class);
- // Graph graph = result.iterator().next();
- Graph graph = result.get(circuitNo);
+ Graph graph = result.iterator().next();
+ // Graph graph = result.get(circuitNo);
db.activate(graph, Integer.MAX_VALUE);
db.close();
-
- // final CustomBarRendererBase renderer = (graph.circuit().isFixedTime() ? new FixedTimeCustomBarRenderer(graph) : new LogarithmicTimedLapsCustomBarRenderer(graph));
- final CustomBarRendererBase renderer = (graph.circuit().isFixedTime() ? new LinearFixedTimeCustomBarRenderer(graph) : new LinearTimedLapsCustomBarRenderer(graph));
+ final CustomBarRendererBase renderer = RendererFactory.newRenderer(graph);
JFrame w = new JFrame("Polepos preview");
JPanel contentPane = new JPanel()
Modified: trunk/polepos/src/org/polepos/reporters/Graph.java
===================================================================
--- trunk/polepos/src/org/polepos/reporters/Graph.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/reporters/Graph.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -28,6 +28,12 @@
public class Graph {
+
+ public static interface ResultProcessor {
+
+ void process(TurnCombination turnCombination, Result result);
+
+ }
private final List<TeamCar>teamCars= new ArrayList<TeamCar>();
private final List<TurnSetup> setups=new ArrayList<TurnSetup>();
@@ -43,6 +49,16 @@
this.circuit = circuit;
this.lap = lap;
}
+
+ Iterable<Result> resultValues(){
+ return results.values();
+ }
+
+ public void traverseResults(ResultProcessor processor){
+ for(Map.Entry<TurnCombination, Result> entry : results.entrySet()){
+ processor.process(entry.getKey(), entry.getValue());
+ }
+ }
public void addResult(TeamCar teamCar, Result result) {
TurnSetup setup = result.getSetup();
Modified: trunk/polepos/src/org/polepos/reporters/PersistGraphReporter.java
===================================================================
--- trunk/polepos/src/org/polepos/reporters/PersistGraphReporter.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/reporters/PersistGraphReporter.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -41,7 +41,7 @@
private void persist(Map<CircuitLap, Graph> graphs) {
new File("graph.db4o").delete();
EmbeddedObjectContainer db = Db4oEmbedded.openFile("graph.db4o");
- db.store(new PersistentGraphs(graphs));
+ // db.store(new PersistentGraphs(graphs));
db.commit();
db.close();
}
Added: trunk/polepos/src/org/polepos/reporters/RendererFactory.java
===================================================================
--- trunk/polepos/src/org/polepos/reporters/RendererFactory.java (rev 0)
+++ trunk/polepos/src/org/polepos/reporters/RendererFactory.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,75 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.reporters;
+
+import java.util.*;
+
+import org.polepos.*;
+import org.polepos.framework.*;
+import org.polepos.reporters.CustomBarRendererBase.*;
+import org.polepos.reporters.Graph.*;
+
+public class RendererFactory {
+
+ private static final double SCALE_FACTOR = 100;
+
+ public static CustomBarRendererBase newRenderer(Graph graph) {
+ if (graph.circuit().isFixedTime()) {
+ if (Settings.LOGARITHMIC) {
+ return new LogarithmicFixedTimeCustomBarRenderer(graph);
+ }
+ return new LinearFixedTimeCustomBarRenderer(graph);
+ }
+ if (Settings.LOGARITHMIC) {
+ return new LogarithmicTimedLapsCustomBarRenderer(graph);
+ }
+ // return new LinearTimedLapsCustomBarRenderer(graph);
+ graph = toFixedTime(graph);
+ return new LinearFixedTimeCustomBarRenderer(graph);
+ }
+
+ private static Graph toFixedTime(final Graph oldGraph) {
+ final Graph newGraph = new Graph(oldGraph.circuit(), oldGraph.lap());
+ final long slowest = findSlowest(oldGraph);
+ oldGraph.traverseResults(new ResultProcessor() {
+ @Override
+ public void process(TurnCombination turnCombination, Result result) {
+ TimedLapsResult timedLapsResult = (TimedLapsResult) result;
+ long time = timedLapsResult.getTime();
+ double factor = (double)slowest / (double)time;
+ long iterations = (long)(factor * SCALE_FACTOR);
+ FixedTimeResult fixedTimeResult = new FixedTimeResult(oldGraph.circuit(),oldGraph.lap(), result.getTeam(), result.getSetup(), result.getLoadMonitoring(), result.getIndex(), iterations);
+ newGraph.addResult(turnCombination.teamCar, fixedTimeResult);
+ }
+ });
+ return newGraph;
+ }
+
+ private static long findSlowest(Graph oldGraph) {
+ long slowest = 0;
+ for(Result result : oldGraph.resultValues()){
+ TimedLapsResult timedLapsResult = (TimedLapsResult) result;
+ slowest = Math.max(slowest, timedLapsResult.getTime());
+ }
+ return slowest;
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/reporters/RendererFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/runner/db4o/AbstractDb4oVersionsRaceRunner.java
===================================================================
--- trunk/polepos/src/org/polepos/runner/db4o/AbstractDb4oVersionsRaceRunner.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/runner/db4o/AbstractDb4oVersionsRaceRunner.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -37,7 +37,6 @@
"0x127ABF",
"0x44BDE0",
"0xFFCA07",
-
};
private int currentColor;
Added: trunk/polepos/src/org/polepos/teams/TeamFactory.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/TeamFactory.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/TeamFactory.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,100 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams;
+
+import java.io.*;
+import java.net.*;
+
+import javax.jms.IllegalStateException;
+
+import org.polepos.framework.*;
+
+public class TeamFactory {
+
+ private static String _workspace;
+
+ protected static Team newTeam(String jar, String folder, String teamName, String...prefixes) {
+ try {
+ File file = new File(folder, jar);
+ if(! file.exists()){
+ throw new IllegalStateException(jar + " not found");
+ }
+ URL jarUrl = file.toURL();
+
+ File[] projectPaths = projectPaths();
+ URL[] urls = new URL[projectPaths.length + 1];
+ for (int projectIdx = 0; projectIdx < projectPaths.length; projectIdx++) {
+ urls[projectIdx] = new File(projectPaths[projectIdx], "bin").toURI().toURL();
+ }
+ urls[urls.length - 1] = jarUrl;
+
+ ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
+ ClassLoader loader=new VersionClassLoader(urls, prefixes, contextClassLoader);
+ try{
+ Thread.currentThread().setContextClassLoader(loader);
+ Class<?> clazz = loader.loadClass(teamName);
+ Team team = (Team) clazz.newInstance();
+ return team;
+ }finally{
+ Thread.currentThread().setContextClassLoader(contextClassLoader);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e);
+ }
+ }
+
+ protected static File[] libPaths() {
+ File[] projectPaths = projectPaths();
+ File[] libPaths = new File[projectPaths.length];
+ for (int pathIdx = 0; pathIdx < projectPaths.length; pathIdx++) {
+ libPaths[pathIdx] = new File(projectPaths[pathIdx], "lib");
+ }
+ return libPaths;
+ }
+
+ protected static File[] projectPaths() {
+ return new File[]{ workspaceFile("polepos")};
+ }
+
+ protected static File workspaceFile(String path) {
+ return new File(workspace(), path);
+ }
+
+ protected static void guessWorkSpace() {
+ File absoluteFile = new File(new File("lib").getAbsolutePath());
+ _workspace = absoluteFile.getParentFile().getParentFile().getAbsolutePath();
+ System.out.println("Guessed workspace:\n" + _workspace + "\n");
+ }
+
+ protected static String workspace() {
+ if(_workspace == null) {
+ _workspace = System.getProperty("polepos.dir");
+ if (_workspace == null) {
+ guessWorkSpace();
+ }
+ }
+ return _workspace;
+ }
+
+
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/TeamFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/teams/hibernate/HibernateTeam.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/hibernate/HibernateTeam.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/hibernate/HibernateTeam.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -35,7 +35,8 @@
public HibernateTeam() {
String[] dbs = Jdbc.settings().getHibernateTypes();
_cars = new Car[dbs.length];
- String[] colors = new String[]{"0x2B439C", "0x44BDE0", "0x127ABF"};
+
+ String[] colors = new String[]{"0x2B439C", "0x8A2BE2", "0x127ABF"};
for (int i = 0; i < dbs.length; i++) {
_cars[i] = new HibernateCar(this, dbs[i], i>=colors.length ? "0x000000" : colors[i]);
}
Modified: trunk/polepos/src/org/polepos/teams/jdo/JdoCar.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jdo/JdoCar.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jdo/JdoCar.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -51,7 +51,7 @@
private String _name;
- JdoCar(Team team, String name, String dbName, String color) {
+ public JdoCar(Team team, String name, String dbName, String color) {
super(team, color);
_jdoName = name;
@@ -151,7 +151,7 @@
properties.setProperty("datanucleus.autoStartMechanism","None");
properties.setProperty("datanucleus.cache.level2.type","ehcache");
- _persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties, JDOHelper.class.getClassLoader());
+ _persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties, Thread.currentThread().getContextClassLoader());
// Datanucleus Schema create
if(_persistenceManagerFactory instanceof JDOPersistenceManagerFactory){
@@ -203,7 +203,7 @@
properties.setProperty("datanucleus.autoCreateSchema", "false");
- _persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties, JDOHelper.class.getClassLoader());
+ _persistenceManagerFactory = JDOHelper.getPersistenceManagerFactory(properties, Thread.currentThread().getContextClassLoader());
}
Modified: trunk/polepos/src/org/polepos/teams/jdo/JdoTeam.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jdo/JdoTeam.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jdo/JdoTeam.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -57,10 +57,12 @@
public class JdoTeam extends Team{
- private final Car[] mCars;
-
- public JdoTeam() {
-
+ protected Car[] mCars;
+
+ protected JdoTeam(boolean initialize){
+ if(! initialize){
+ return;
+ }
String[] impls = Jdo.settings().getJdoImplementations();
if(impls == null){
@@ -94,7 +96,11 @@
mCars = new Car[ cars.size() ];
cars.toArray(mCars);
}
-
+
+ }
+
+ public JdoTeam() {
+ this(true);
}
Added: trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeam.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeam.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeam.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,51 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams.jdo;
+
+import org.polepos.framework.*;
+
+public class VodJdoTeam extends JdoTeam {
+
+ private transient ClassLoader _standardClassLoader;
+
+ private transient ClassLoader _versionClassLoader;
+
+ public VodJdoTeam() {
+ super(false);
+ _versionClassLoader = getClass().getClassLoader();
+ String name = "vod8";
+ mCars = new Car[]{new JdoCar(this, name, null, Jdo.settings().color(name))};
+ }
+
+ @Override
+ public void setUp() {
+ _standardClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(_versionClassLoader);
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() {
+ super.tearDown();
+ Thread.currentThread().setContextClassLoader(_standardClassLoader);
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeam.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeamFactory.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeamFactory.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeamFactory.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,39 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams.jdo;
+
+import org.polepos.framework.*;
+import org.polepos.teams.*;
+
+/**
+ * VOD JDO and VOD JPA are not compatible to run in the same ClassLoader
+ * space. That's why we use a special classloader for VOD JDO that knows
+ * it's vodjdo.jar.
+ *
+ */
+public class VodJdoTeamFactory extends TeamFactory{
+
+ public static Team newVodJdoTeam(){
+ return newTeam("vodjdo.jar", "lib/vod", "org.polepos.teams.jdo.VodJdoTeam", "com.versant", "org.polepos.teams.jdo");
+ }
+
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/jdo/VodJdoTeamFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/teams/jpa/JpaTeam.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/JpaTeam.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/JpaTeam.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -19,8 +19,8 @@
package org.polepos.teams.jpa;
-import java.util.ArrayList;
-import java.util.List;
+import java.io.*;
+import java.util.*;
import javax.persistence.*;
@@ -45,9 +45,27 @@
*/
public class JpaTeam extends Team{
- private final Car[] mCars;
+ protected Car[] mCars;
+
+ final Map<String, JpaCarFactory> factories = new HashMap<String, JpaCarFactory>();
+
+ public JpaTeam() {
+ this(true);
+ }
- public JpaTeam() {
+ public JpaTeam(boolean initialize) {
+
+ if(! initialize){
+ return;
+ }
+
+ factories.put("vodjpa", new JpaCarFactory() {
+ @Override
+ public JpaCar newInstance(JpaTeam team, String name, String dbName, String color) throws IOException {
+ return new VodJpaCar(team, name, dbName, color);
+ }
+ });
+
String[] impls = Jpa.settings().getJpaImplementations();
@@ -72,7 +90,12 @@
}
}else{
try {
- cars.add(new JpaCar(this, impl, null, Jpa.settings().color(impl)));
+ JpaCarFactory jpaCarFactory = factories.get(impl);
+ if(jpaCarFactory != null){
+ cars.add(jpaCarFactory.newInstance(this, impl, null, Jpa.settings().color(impl)));
+ } else {
+ cars.add(new JpaCar(this, impl, null, Jpa.settings().color(impl)));
+ }
} catch (Exception e) {
e.printStackTrace();
}
@@ -128,22 +151,31 @@
}
public void setUp() {
- for(int i = 0; i < mCars.length;i++){
- EntityManager em = ((JpaCar)mCars[i]).getEntityManager();
- delete(em, ComplexHolder0.class);
- delete(em, InheritanceHierarchy0.class);
- delete(em, JpaIndexedObject.class);
- delete(em, ListHolder.class);
- delete(em, JPB0.class);
- delete(em, JpaIndexedPilot.class);
- delete(em, JpaPilot.class);
- delete(em, JpaTree.class);
- delete(em, JpaLightObject.class);
- delete(em, JpaListHolder.class);
- delete(em, JPN1.class);
+ for(int i = 0; i < mCars.length;i++){
+ JpaCar jpaCar = (JpaCar)mCars[i];
+ if(jpaCar.canRecreateDatabase()){
+ jpaCar.recreateDatabase();
+ } else {
+ deleteAllPersistentClasses(jpaCar);
+ }
}
-
}
+
+
+ private void deleteAllPersistentClasses(JpaCar jpaCar) {
+ EntityManager em = jpaCar.getEntityManager();
+ delete(em, ComplexHolder0.class);
+ delete(em, InheritanceHierarchy0.class);
+ delete(em, JpaIndexedObject.class);
+ delete(em, ListHolder.class);
+ delete(em, JPB0.class);
+ delete(em, JpaIndexedPilot.class);
+ delete(em, JpaPilot.class);
+ delete(em, JpaTree.class);
+ delete(em, JpaLightObject.class);
+ delete(em, JpaListHolder.class);
+ delete(em, JPN1.class);
+ }
private void delete(EntityManager em, Class clazz){
em.getTransaction().begin();
Added: trunk/polepos/src/org/polepos/teams/jpa/VodJpaCar.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/VodJpaCar.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/jpa/VodJpaCar.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,54 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams.jpa;
+
+import java.io.*;
+
+import org.polepos.framework.*;
+
+import com.versant.admin.*;
+
+public class VodJpaCar extends JpaCar{
+
+ private String _connectUrl;
+
+ public VodJpaCar(Team team, String name, String dbName, String color) throws IOException {
+ super(team, name, dbName, color);
+ _connectUrl = Jpa.settings().getConnectUrl(name);
+ }
+
+ @Override
+ public boolean canRecreateDatabase() {
+ return true;
+ }
+
+ @Override
+ public void recreateDatabase() {
+ ServerAdministration.removeDatabase(_connectUrl);
+ ServerAdministration.createDatabase(_connectUrl);
+ try {
+ reinitialize();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/jpa/VodJpaCar.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeam.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeam.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeam.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,53 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams.jpa;
+
+import java.io.*;
+
+import org.polepos.framework.*;
+
+public class VodJpaTeam extends JpaTeam {
+
+ private transient ClassLoader _standardClassLoader;
+
+ private transient ClassLoader _versionClassLoader;
+
+ public VodJpaTeam() throws IOException {
+ super(false);
+ _versionClassLoader = getClass().getClassLoader();
+ String name = "vodjpa";
+ mCars = new Car[]{new VodJpaCar(this, name, null, Jpa.settings().color(name))};
+ }
+
+ @Override
+ public void setUp() {
+ _standardClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(_versionClassLoader);
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() {
+ super.tearDown();
+ Thread.currentThread().setContextClassLoader(_standardClassLoader);
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeam.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeamFactory.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeamFactory.java (rev 0)
+++ trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeamFactory.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -0,0 +1,38 @@
+/*
+This file is part of the PolePosition database benchmark
+http://www.polepos.org
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public
+License along with this program; if not, write to the Free
+Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+MA 02111-1307, USA. */
+
+
+package org.polepos.teams.jpa;
+
+import org.polepos.framework.*;
+import org.polepos.teams.*;
+
+/**
+ * VOD JDO and VOD JPA are not compatible to run in the same ClassLoader
+ * space. That's why we use a special classloader for VOD JDO that knows
+ * it's vodjdo.jar.
+ *
+ */
+public class VodJpaTeamFactory extends TeamFactory{
+
+ public static Team newVodJpaTeam(){
+ return newTeam("vodjpa.jar", "lib/vod", "org.polepos.teams.jpa.VodJpaTeam", "com.versant", "org.polepos.teams.jpa");
+ }
+
+}
Property changes on: trunk/polepos/src/org/polepos/teams/jpa/VodJpaTeamFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/ComplexHolder2.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/ComplexHolder2.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/ComplexHolder2.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -22,12 +22,11 @@
import javax.persistence.Entity;
-import org.apache.openjpa.persistence.jdbc.Index;
-
@Entity
+...@co...dex(name="ii2", attributes={"i2"})
public class ComplexHolder2 extends ComplexHolder1 {
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
public int i2;
public int getI2() {
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/InheritanceHierarchy2.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/InheritanceHierarchy2.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/InheritanceHierarchy2.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -24,9 +24,10 @@
import org.apache.openjpa.persistence.jdbc.Index;
@Entity
+...@co...dex(name="iihi2", attributes={"i2"})
public class InheritanceHierarchy2 extends InheritanceHierarchy1{
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
private int i2; // index this one for queries
public InheritanceHierarchy2(){
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/JPB2.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/JPB2.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/JPB2.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -19,17 +19,16 @@
package org.polepos.teams.jpa.data;
-import javax.persistence.Entity;
+import javax.persistence.*;
-import org.apache.openjpa.persistence.jdbc.Index;
-
/**
* @author Christian Ernst
*/
+...@co...dex(name="ib2", attributes={"b2"})
@Entity
public class JPB2 extends JPB1{
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
private int b2; // index this one for queries
public JPB2(){
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedObject.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedObject.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedObject.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -20,26 +20,26 @@
package org.polepos.teams.jpa.data;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
+import javax.persistence.*;
-import org.apache.openjpa.persistence.jdbc.Index;
-import org.polepos.data.IndexedObject;
-import org.polepos.framework.CheckSummable;
+import org.polepos.data.*;
+import org.polepos.framework.*;
@Entity
+...@co...dexes({
+ @com.versant.jpa.annotations.Index(name="i_int", attributes={"_int"}),
+ @com.versant.jpa.annotations.Index(name="i_string", attributes={"_string"})
+})
public class JpaIndexedObject implements CheckSummable{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long oid;
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
public int _int;
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
public String _string;
public JpaIndexedObject(){
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedPilot.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedPilot.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/JpaIndexedPilot.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -21,7 +21,6 @@
import javax.persistence.*;
-import org.apache.openjpa.persistence.jdbc.*;
import org.polepos.framework.*;
@@ -29,17 +28,21 @@
* @author Christian Ernst
*/
@Entity
+...@co...dexes({
+ @com.versant.jpa.annotations.Index(name="iName", attributes={"mName"}),
+ @com.versant.jpa.annotations.Index(name="iLicenseID", attributes={"mLicenseID"})
+})
public class JpaIndexedPilot implements CheckSummable
{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long oid;
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
private String mName;
private String mFirstName;
private int mPoints;
- @Index
+ @org.apache.openjpa.persistence.jdbc.Index
private int mLicenseID;
Modified: trunk/polepos/src/org/polepos/teams/jpa/data/JpaListHolder.java
===================================================================
--- trunk/polepos/src/org/polepos/teams/jpa/data/JpaListHolder.java 2011-11-09 17:13:52 UTC (rev 232)
+++ trunk/polepos/src/org/polepos/teams/jpa/data/JpaListHolder.java 2011-12-12 12:45:40 UTC (rev 233)
@@ -5,12 +5,7 @@
import java.util.ArrayList;
import java.util.List;
-import javax.persistence.Basic;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
+import javax.persistence.*;
import org.polepos.framework.CheckSummable;
@@ -24,8 +19,6 @@
@GeneratedValue(strategy=GenerationType.AUTO)
private long oid;
- @Basic
- @Lob
public List<Integer> list;
public JpaListHolder(){
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|