Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Examples/JPA/Simulation

< EclipseLink‎ | Examples‎ | JPA
Revision as of 15:59, 1 September 2009 by Unnamed Poltroon (Talk) (Design)

Simulation JPA Application Example

Purpose

  • This sumulation will serve as a near real world enterprise application that showcases utilizing JPA as the persistence or integration layer - specifically using EclipseLink JPA as the provider.
  • This enterprise application will offer the services of a simulated connection machine (Ref: Thinking Machines CM-2) symbolic vector processor.
    • Why are we choosing an older architecture to simulate?
      • a) The architecture is very clean and even though it is very large - is simple enough to implement.
      • b) The design is proven and static - as it has been superceeded by more powerfull designs).
      • c) The massively parallel processing design of the CM-2 matches our goal of utilizing parallelism at both the thread and multi-core processor level on our host machine.

Goals

  • We would like to explore the following limits of the JPA provider and hosting application server.
    • Performance and Volumetrics: We require 65536 processor objects.

Infrastructure

  • OS: Windows XP or Vista 32/64 bit
  • Database: Oracle 11gR1
  • JPA provider: EclipseLink 1.2
  • JDK: Sun 1.6.0_14

Analysis

Data Model

Processor Architecture

  • Each CM-2 processor is composed of up to 64k (65536) 1-bit processors arranged in a 12-dimensional hypercube.
    • There are 16 1-bit processors per chip along with 1 routing processor per chip.
      • There are 32 cpu chips and 32 ram chips per backplane board
        • There are 16 boards per quadrant
          • There are 8 quadrands to a CM-2
    • We therefore have (2^4=16) x (2^5=32) x (2^4=16) x (2^3=8) = 2^16 = 65536 possible processors in a fully configured system.

Hierarchy

  • Hypercube (quadrants(1:M), input, output, program)
  • Quadrant (boards(1:M), hypercube(1:1))
  • Board (processorChips(1:M), ramChips(1:M))
  • Chip(A)
    • ProcessorChip (processors (1:M), router (1:1))
    • MemoryChip
  • Processor(A)
    • VectorProcessor(alu, stateMachine, uProgram)
    • RouterProcessor (routers(1:M))

Design

JPA Data Model

Implementation

Schema Model

Persistence Unit

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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">
	<persistence-unit name="CMJPA_create" transaction-type="RESOURCE_LOCAL">
	<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<class>org.eclipse.persistence.example.jpa.cm.business.Board</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.Hypercube</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.MemoryChip</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.ProcessorChip</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.Quadrant</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.RouterProcessor</class>
		<class>org.eclipse.persistence.example.jpa.cm.business.VectorProcessor</class>
       <properties>
            <property name="eclipselink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
            <property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.oracle.OraclePlatform"/>            
            <property name="eclipselink.jdbc.url" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl"/>
            <property name="eclipselink.jdbc.user" value="scott"/>
            <property name="eclipselink.jdbc.password" value="pw"/>
            <!-- property name="eclipselink.logging.level" value="ALL"/-->            
            <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
            <property name="eclipselink.ddl-generation.output-mode" value="database"/>
       </properties>
	</persistence-unit>
</persistence>

Testing

  • In order to accommidate a 65MB heap size use the JVM parameter
    • -Xmx1024m

Console Output

Logs

_persisted 65536 Processor Entities
_All Processors: 65536
_Metamodel: MetamodelImpl@31301308 [ 11 Types: , 9 ManagedTypes: , 7 EntityTypes: , 2 MappedSuperclassTypes: , 0 EmbeddableTypes: ]
[EL Info]: 2009-09-01 15:52:30.633--ServerSession(23979164)--file:/E:/wse/view_w35a/CM2JPA/bin/-CMJPA_create logout successful
org.eclipse.persistence.example.jpa.cm.integration.CM2@2a72b6

Appendices

References

Back to the top