Browse Source

Merge branch 'master' of github.com:TechEmpower/FrameworkBenchmarks

Alex Schneider 11 years ago
parent
commit
2fa322df35

+ 0 - 0
wildfly-ee7/__init__.py


+ 26 - 0
wildfly-ee7/benchmark_config

@@ -0,0 +1,26 @@
+{
+  "framework": "wildfly-ee7",
+  "tests": [{
+    "mysql" : {
+      "setup_file": "setup",
+      "db_url": "/wildfly-ee7/rest/db",
+      "query_url": "/wildfly-ee7/rest/queries?queries=",
+      "fortune_url": "/wildfly-ee7/fortunes.xhtml",
+      "update_url": "/wildfly-ee7/rest/updates?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Platform",
+      "database": "MySQL",
+      "framework": "EE7",
+      "language": "Java",
+      "orm": "Full",
+      "platform": "Servlet",
+      "webserver": "Wildfly",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "wildfly-ee7",
+      "notes": "",
+      "versus": ""
+    }   
+  }]
+}

+ 199 - 0
wildfly-ee7/pom.xml

@@ -0,0 +1,199 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>com.techempower</groupId>
+	<artifactId>wildfly-ee7</artifactId>
+	<version>0.1</version>
+	<packaging>war</packaging>
+
+	<properties>
+		<database.host>localhost</database.host>
+		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+		<version.compiler.plugin>3.1</version.compiler.plugin>
+		<version.war.plugin>2.4</version.war.plugin>
+		<version.wildfly>8.1.0.Final</version.wildfly>
+		<version.mysql.connector>5.1.29</version.mysql.connector>
+		<version.javaee.api>7.0</version.javaee.api>
+		<version.jboss.spec.javaee.7.0>1.0.0.Final</version.jboss.spec.javaee.7.0>
+	</properties>
+
+	<repositories>
+		<repository>
+			<id>jboss-public-repository-group</id>
+			<name>JBoss Public Maven Repository Group</name>
+			<url>https://repository.jboss.org/nexus/content/groups/public-jboss/</url>
+			<layout>default</layout>
+			<releases>
+				<enabled>true</enabled>
+				<updatePolicy>never</updatePolicy>
+			</releases>
+			<snapshots>
+				<enabled>true</enabled>
+				<updatePolicy>never</updatePolicy>
+			</snapshots>
+		</repository>
+	</repositories>
+
+	<dependencyManagement>
+		<dependencies>
+			<dependency>
+				<groupId>org.jboss.spec</groupId>
+				<artifactId>jboss-javaee-7.0</artifactId>
+				<version>${version.jboss.spec.javaee.7.0}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+
+			<dependency>
+				<groupId>org.wildfly</groupId>
+				<artifactId>wildfly-dist-parent</artifactId>
+				<version>${version.wildfly}</version>
+				<type>pom</type>
+				<scope>import</scope>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+
+	<dependencies>
+
+		<dependency>
+			<groupId>javax</groupId>
+			<artifactId>javaee-api</artifactId>
+			<version>${version.javaee.api}</version>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.spec.javax.servlet</groupId>
+			<artifactId>jboss-servlet-api_3.1_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.resteasy</groupId>
+			<artifactId>resteasy-jaxrs</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.spec.javax.ejb</groupId>
+			<artifactId>jboss-ejb-api_3.2_spec</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+		<dependency>
+			<groupId>org.jboss.logging</groupId>
+			<artifactId>jboss-logging</artifactId>
+			<scope>provided</scope>
+		</dependency>
+
+	</dependencies>
+
+	<build>
+		<finalName>${project.artifactId}</finalName>
+		<plugins>
+			<plugin>
+				<artifactId>maven-war-plugin</artifactId>
+				<version>${version.war.plugin}</version>
+				<configuration>
+					<failOnMissingWebXml>false</failOnMissingWebXml>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<version>${version.compiler.plugin}</version>
+				<configuration>
+					<source>1.7</source>
+					<target>1.7</target>
+					<optimize>true</optimize>
+					<debug>false</debug>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+	<profiles>
+		<profile>
+			<id>benchmark</id>
+			<build>
+				<plugins>
+					<plugin>
+						<artifactId>maven-war-plugin</artifactId>
+						<version>${version.war.plugin}</version>
+						<configuration>
+							<failOnMissingWebXml>false</failOnMissingWebXml>
+							<outputDirectory>${project.build.directory}/wildfly-${version.wildfly}/standalone/deployments</outputDirectory>
+						</configuration>
+					</plugin>
+					<plugin>
+						<groupId>org.apache.maven.plugins</groupId>
+						<artifactId>maven-dependency-plugin</artifactId>
+						<version>2.8</version>
+						<executions>
+							<execution>
+								<phase>initialize</phase>
+								<id>unpack-wildfly-server</id>
+								<goals>
+									<goal>unpack</goal>
+								</goals>
+								<configuration>
+									<artifactItems>
+										<artifactItem>
+											<groupId>org.wildfly</groupId>
+											<artifactId>wildfly-dist</artifactId>
+											<version>${version.wildfly}</version>
+											<type>zip</type>
+											<overWrite>false</overWrite>
+											<outputDirectory>${project.build.directory}</outputDirectory>
+										</artifactItem>
+									</artifactItems>
+								</configuration>
+							</execution>
+							<execution>
+								<phase>initialize</phase>
+								<id>copy-mysql-driver</id>
+								<goals>
+									<goal>copy</goal>
+								</goals>
+								<configuration>
+									<artifactItems>
+										<artifactItem>
+											<groupId>mysql</groupId>
+											<artifactId>mysql-connector-java</artifactId>
+											<version>${version.mysql.connector}</version>
+											<type>jar</type>
+											<outputDirectory>${project.build.directory}/wildfly-${version.wildfly}/standalone/deployments</outputDirectory>
+										</artifactItem>
+									</artifactItems>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+					<plugin>
+						<artifactId>maven-resources-plugin</artifactId>
+						<version>2.6</version>
+						<executions>
+							<execution>
+								<phase>initialize</phase>
+								<id>copy-mysql-datasource</id>
+								<goals>
+									<goal>copy-resources</goal>
+								</goals>
+								<configuration>
+									<outputDirectory>${project.build.directory}/wildfly-${version.wildfly}/standalone/deployments</outputDirectory>
+									<resources>
+										<resource>
+											<directory>${basedir}/server-resources/datasources</directory>
+											<filtering>true</filtering>
+										</resource>
+									</resources>
+								</configuration>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+</project>

+ 21 - 0
wildfly-ee7/server-resources/datasources/mysql-ds.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources xmlns="http://www.jboss.org/ironjacamar/schema">
+    <datasource jta="true" jndi-name="java:jboss/datasources/helloWorld" pool-name="MySqlDS" enabled="true" use-java-context="true" use-ccm="true">
+		<connection-url>jdbc:mysql://${database.host}:3306/hello_world?jdbcCompliantTruncation=false&amp;elideSetAutoCommits=true&amp;useLocalSessionState=true&amp;cachePrepStmts=true&amp;cacheCallableStmts=true&amp;alwaysSendSetIsolation=false&amp;prepStmtCacheSize=4096&amp;cacheServerConfiguration=true&amp;prepStmtCacheSqlLimit=2048&amp;traceProtocol=false&amp;useServerPrepStmts=true&amp;enableQueryTimeouts=false&amp;useUnbufferedIO=false&amp;useReadAheadInput=false&amp;maintainTimeStats=false&amp;cacheRSMetadata=true</connection-url>
+		<driver>mysql-connector-java-${version.mysql.connector}.jar</driver>
+		<pool>
+		    <prefill>false</prefill>
+		    <min-pool-size>32</min-pool-size>
+		    <max-pool-size>256</max-pool-size>
+		</pool>
+		<security>
+		    <user-name>benchmarkdbuser</user-name>
+		    <password>benchmarkdbpass</password>
+		</security>
+		<validation>
+		    <validate-on-match>false</validate-on-match>
+		    <background-validation>false</background-validation>
+		    <use-fast-fail>false</use-fast-fail>
+		</validation>
+     </datasource>
+</datasources>

+ 20 - 0
wildfly-ee7/setup.py

@@ -0,0 +1,20 @@
+import subprocess
+import sys
+import setup_util
+import os
+
+def start(args, logfile, errfile):
+  wildfly_env = os.environ.copy()
+  wildfly_env['JAVA_OPTS'] = "-Xms2g -Xmx2g -XX:MaxPermSize=256m -XX:+UseG1GC -XX:MaxGCPauseMillis=25 -verbosegc -Xloggc:/tmp/wildfly_gc.log"
+  try:
+    subprocess.check_call("mvn clean initialize package -Pbenchmark -Ddatabase.host=" + args.database_host, shell=True, cwd="wildfly-ee7", stderr=errfile, stdout=logfile)
+    subprocess.Popen("target/wildfly-8.1.0.Final/bin/standalone.sh -b 0.0.0.0", shell=True, env=wildfly_env, cwd="wildfly-ee7", stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1
+def stop(logfile, errfile):
+  try:
+    subprocess.check_call("target/wildfly-8.1.0.Final/bin/jboss-cli.sh --connect --command=:shutdown", shell=True, cwd="wildfly-ee7", stderr=errfile, stdout=logfile)
+    return 0
+  except subprocess.CalledProcessError:
+    return 1

+ 27 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/jpa/PersistenceResources.java

@@ -0,0 +1,27 @@
+package com.techempower.ee7.jpa;
+
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.Produces;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.PersistenceUnit;
+import javax.persistence.SynchronizationType;
+
+public class PersistenceResources {
+
+  @PersistenceUnit
+  private EntityManagerFactory entityManagerFactory;
+
+  @Produces
+  @RequestScoped
+  public EntityManager entityManager() {
+    return entityManagerFactory.createEntityManager(SynchronizationType.UNSYNCHRONIZED);
+  }
+
+  protected void closeEntityManager(@Disposes EntityManager entityManager) {
+    if (entityManager.isOpen()) {
+      entityManager.close();
+    }
+  }
+}

+ 60 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/model/Fortune.java

@@ -0,0 +1,60 @@
+package com.techempower.ee7.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.NamedQuery;
+import javax.validation.constraints.NotNull;
+import javax.validation.constraints.Size;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@NamedQuery(name = "allFortunes", query = "SELECT f FROM Fortune f")
+@XmlRootElement
+@Entity
+public class Fortune implements Comparable<Fortune>, Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  private int id;
+  private String message;
+
+  public Fortune() {
+
+  }
+
+  public Fortune(int id, String message) {
+    this.id = id;
+    this.message = message;
+  }
+
+  @XmlElement
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public int getId() {
+    return id;
+  }
+
+  public void setId(int id) {
+    this.id = id;
+  }
+
+  @XmlElement
+  @NotNull
+  @Size(max = 2048)
+  public String getMessage() {
+    return message;
+  }
+
+  public void setMessage(String message) {
+    this.message = message;
+  }
+
+  @Override
+  public int compareTo(Fortune o) {
+    return message.compareTo(o.getMessage());
+  }
+}

+ 42 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/model/World.java

@@ -0,0 +1,42 @@
+package com.techempower.ee7.model;
+
+import java.io.Serializable;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.validation.constraints.NotNull;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement
+@Entity
+public class World implements Serializable {
+
+  private static final long serialVersionUID = 1L;
+
+  private int id;
+  private int randomNumber;
+
+  @XmlElement
+  @Id
+  @GeneratedValue(strategy = GenerationType.AUTO)
+  public int getId() {
+    return id;
+  }
+
+  public void setId(int id) {
+    this.id = id;
+  }
+
+  @XmlElement
+  @NotNull
+  public int getRandomNumber() {
+    return randomNumber;
+  }
+
+  public void setRandomNumber(int randomNumber) {
+    this.randomNumber = randomNumber;
+  }
+}

+ 22 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/rest/CatchAllExceptionMapper.java

@@ -0,0 +1,22 @@
+package com.techempower.ee7.rest;
+
+import javax.inject.Inject;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.Provider;
+
+import org.jboss.logging.Logger;
+
+@Provider
+public class CatchAllExceptionMapper implements ExceptionMapper<Exception> {
+
+  @Inject
+  private Logger log;
+
+  @Override
+  public Response toResponse(Exception exception) {
+    log.info("Request Failed: " + exception.getMessage());
+    return Response.status(Status.BAD_REQUEST).build();
+  }
+}

+ 7 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/rest/MyApplication.java

@@ -0,0 +1,7 @@
+package com.techempower.ee7.rest;
+
+import javax.ws.rs.ApplicationPath;
+import javax.ws.rs.core.Application;
+
+@ApplicationPath("rest")
+public class MyApplication extends Application {}

+ 36 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/Fortunes.java

@@ -0,0 +1,36 @@
+package com.techempower.ee7.tests;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.persistence.EntityManager;
+
+import com.techempower.ee7.model.Fortune;
+
+@RequestScoped
+@Named
+public class Fortunes {
+
+  private static final int ADDITIONAL_FORTUNE_ID = 0;
+  private static final String ADDITIONAL_FORTUNE_CONTENT = "Additional fortune added at request time.";
+  
+  @Inject
+  private EntityManager em;
+
+  private List<Fortune> data;
+
+  @PostConstruct
+  private void postConstruct() {
+    data = em.createNamedQuery("allFortunes", Fortune.class).getResultList();
+    data.add(new Fortune(ADDITIONAL_FORTUNE_ID, ADDITIONAL_FORTUNE_CONTENT));
+    Collections.sort(data);
+  }
+
+  public List<Fortune> getData() {
+    return data;
+  }
+}

+ 35 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/JsonSerialization.java

@@ -0,0 +1,35 @@
+package com.techempower.ee7.tests;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@Path("/json")
+public class JsonSerialization {
+
+  private static final String MESSAGE = "Hello, World!";
+
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  public JsonResponse get() {
+    return new JsonResponse(MESSAGE);
+  }
+
+  @XmlRootElement
+  public class JsonResponse {
+
+    private final String message;
+
+    public JsonResponse(String message) {
+      this.message = message;
+    }
+
+    @XmlElement
+    public String getMessage() {
+      return message;
+    }
+  }
+}

+ 41 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/MultipleQueries.java

@@ -0,0 +1,41 @@
+package com.techempower.ee7.tests;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import com.techempower.ee7.model.World;
+import com.techempower.ee7.util.Helpers;
+
+@Path("/queries")
+public class MultipleQueries {
+
+  private static final int MIN_QUERIES = 1;
+  private static final int MAX_QUERIES = 500;
+
+  @Inject
+  private EntityManager em;
+
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  public List<World> get(@QueryParam("queries") final String queries) {
+    final int iterations =
+        Helpers.boundedIntegerFromNullableString(queries, MIN_QUERIES, MAX_QUERIES);
+
+    List<World> result = new ArrayList<>(iterations);
+
+    for (int i = 0; i < iterations; i++) {
+      int id = Helpers.randomWorldId();
+      result.add(em.find(World.class, id));
+    }
+
+    return result;
+  }
+}

+ 17 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/PlainText.java

@@ -0,0 +1,17 @@
+package com.techempower.ee7.tests;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+@Path("/plaintext")
+public class PlainText {
+  private static final String MESSAGE = "Hello, World!";
+
+  @GET
+  @Produces(MediaType.TEXT_PLAIN)
+  public String get() {
+    return MESSAGE;
+  }
+}

+ 25 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/SingleQuery.java

@@ -0,0 +1,25 @@
+package com.techempower.ee7.tests;
+
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.MediaType;
+
+import com.techempower.ee7.model.World;
+import com.techempower.ee7.util.Helpers;
+
+@Path("/db")
+public class SingleQuery {
+
+  @Inject
+  private EntityManager em;
+
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  public World get() {
+    int id = Helpers.randomWorldId();
+    return em.find(World.class, id);
+  }
+}

+ 61 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/tests/Updates.java

@@ -0,0 +1,61 @@
+package com.techempower.ee7.tests;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.inject.Inject;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceException;
+import javax.transaction.Transactional;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
+
+import org.jboss.logging.Logger;
+
+import com.techempower.ee7.model.World;
+import com.techempower.ee7.util.Helpers;
+
+@Path("/updates")
+public class Updates {
+
+  private static final int MIN_QUERIES = 1;
+  private static final int MAX_QUERIES = 500;
+
+  @Inject
+  private EntityManager em;
+
+  @Inject
+  private Logger log;
+
+  @Transactional
+  @GET
+  @Produces(MediaType.APPLICATION_JSON)
+  public List<World> update(@QueryParam("queries") final String queries) {
+    final int iterations =
+        Helpers.boundedIntegerFromNullableString(queries, MIN_QUERIES, MAX_QUERIES);
+
+    List<World> worlds = new ArrayList<>(iterations);
+
+    for (int i = 0; i < iterations; i++) {
+      int id = Helpers.randomWorldId();
+      worlds.add(em.find(World.class, id));
+    }
+
+    for (World w : worlds) {
+      w.getRandomNumber(); // Mandatory to read for the test
+      w.setRandomNumber(Helpers.randomWorldId());
+    }
+
+    try {
+      em.joinTransaction();
+      em.flush();
+    } catch (PersistenceException e) {
+      log.info("Failed to flush changes to database.");
+      throw e;
+    }
+    return worlds;
+  }
+}

+ 36 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/util/Helpers.java

@@ -0,0 +1,36 @@
+package com.techempower.ee7.util;
+
+import java.util.concurrent.ThreadLocalRandom;
+
+public class Helpers {
+
+  /**
+   * Random number between 1 and 10,000
+   * 
+   * @return
+   */
+  public static int randomWorldId() {
+    return ThreadLocalRandom.current().nextInt(1, 10001);
+  }
+
+  /**
+   * Returns a bounded integer. min if null or less than bounds. max if greater than bounds
+   * 
+   * @param value
+   * @param min
+   * @param max
+   * @return
+   */
+  public static int boundedIntegerFromNullableString(final String value, final int min,
+      final int max) {
+    if (value == null) {
+      return min;
+    } else {
+      try {
+        return Math.min(max, Math.max(min, Integer.parseInt(value)));
+      } catch (NumberFormatException e) {
+        return min;
+      }
+    }
+  }
+}

+ 15 - 0
wildfly-ee7/src/main/java/com/techempower/ee7/util/LoggerProducer.java

@@ -0,0 +1,15 @@
+package com.techempower.ee7.util;
+
+import javax.enterprise.inject.Produces;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.logging.Logger;
+
+public class LoggerProducer {
+
+  @Produces
+  Logger produceLog(InjectionPoint injectionPoint) {
+    return Logger.getLogger(injectionPoint.getBean() != null ? injectionPoint.getBean()
+        .getBeanClass() : injectionPoint.getMember().getDeclaringClass());
+  }
+}

+ 12 - 0
wildfly-ee7/src/main/resources/META-INF/persistence.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.1"
+	xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+	<persistence-unit name="primary" transaction-type="JTA">
+		<jta-data-source>java:jboss/datasources/helloWorld</jta-data-source>
+		<shared-cache-mode>NONE</shared-cache-mode>
+		<properties>
+			<property name="hibernate.jdbc.batch_size" value="100" />
+		</properties>
+	</persistence-unit>
+</persistence>

+ 4 - 0
wildfly-ee7/src/main/webapp/WEB-INF/beans.xml

@@ -0,0 +1,4 @@
+<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
+	version="1.1" bean-discovery-mode="all">
+</beans>

+ 30 - 0
wildfly-ee7/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
+
+	<session-config>
+		<session-timeout>1</session-timeout>
+	</session-config>
+
+	<servlet>
+		<servlet-name>Faces Servlet</servlet-name>
+		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+		<load-on-startup>1</load-on-startup>
+	</servlet>
+
+	<servlet-mapping>
+		<servlet-name>Faces Servlet</servlet-name>
+		<url-pattern>*.xhtml</url-pattern>
+	</servlet-mapping>
+
+	<context-param>
+		<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+		<param-value>client</param-value>
+	</context-param>
+
+	<context-param>
+		<param-name>javax.faces.PROJECT_STAGE</param-name>
+		<param-value>Production</param-value>
+	</context-param>
+
+</web-app>

+ 20 - 0
wildfly-ee7/src/main/webapp/fortunes.xhtml

@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Fortunes</title>
+</head>
+<h:body xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:h="http://xmlns.jcp.org/jsf/html">
+	<table>
+		<tr>
+			<th>id</th>
+			<th>message</th>
+		</tr>
+		<ui:repeat var="_f" value="#{fortunes.data}">
+			<tr>
+				<td><h:outputText value="#{_f.id}" /></td>
+				<td><h:outputText value="#{_f.message}" /></td>
+			</tr>
+		</ui:repeat>
+	</table>
+</h:body>
+</html>