You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by st...@apache.org on 2015/06/01 22:19:02 UTC
svn commit: r953480 [37/37] - in
/websites/production/openjpa/content/builds/2.4.0: ./ apache-openjpa/
apache-openjpa/docs/
Added: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_sequence.html
==============================================================================
--- websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_sequence.html (added)
+++ websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_sequence.html Mon Jun 1 20:19:00 2015
@@ -0,0 +1,296 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>6. Generators</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.4 User's Guide"><link rel="up" href="ref_guide_runtime.html" title="Chapter 9. Runtime Extensions"><link rel="prev" href="ref_guide_enterprise_methodql.html" title="5. MethodQL"><link rel="next" href="ref_guide_runtime_pm_event.html" title="7. Transaction Events"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">6.
+ Generators
+ </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_enterprise_methodql.html">Prev</a> </td><th width="60%" align="center">Chapter 9.
+ Runtime Extensions
+ </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_runtime_pm_event.html">Next</a></td></tr></table><hr></div><div class="section" title="6. Generators"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="ref_guide_sequence">6.
+ Generators
+ </h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ref_guide_sequence.html#ref_guide_sequence_runtime">6.1.
+ Runtime Access
+ </a></span></dt></dl></div>
+
+ <a class="indexterm" name="d5e15738"></a>
+ <p>
+The JPA Overview's <a class="xref" href="jpa_overview_mapping.html" title="Chapter 13. Mapping Metadata">Chapter 13, <i>
+ Mapping Metadata
+ </i></a> details using
+generators to automatically populate identity fields in JPA.
+ </p>
+ <p>
+OpenJPA represents all generators internally with the
+<a class="ulink" href="../javadoc/org/apache/openjpa/kernel/Seq.html" target="_top"><code class="classname">
+org.apache.openjpa.kernel.Seq</code></a> interface. This interface
+supplies all the context you need to create your own custom generators,
+including the current persistence environment, the JDBC <code class="classname">DataSource
+</code>, and other essentials. The
+<a class="ulink" href="../javadoc/org/apache/openjpa/jdbc/kernel/AbstractJDBCSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.jdbc.kernel.AbstractJDBCSeq</code></a>
+helps you create custom JDBC-based sequences. OpenJPA also supplies the
+following built-in <code class="classname">Seq</code>s:
+ </p>
+ <div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
+ <p>
+ <a class="indexterm" name="d5e15753"></a>
+<code class="literal">table</code>: This is OpenJPA's default implementation. It is an
+alias for the
+<a class="ulink" href="../javadoc/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.jdbc.kernel.TableJDBCSeq</code></a>
+class. The <code class="classname">TableJDBCSeq</code> uses a special single-row table
+to store a global sequence number. If the table does not already exist, it is
+created the first time you run the
+<a class="link" href="ref_guide_mapping.html#ref_guide_mapping_mappingtool" title="1. Forward Mapping">mapping tool</a> on a class
+that requires it. You can also use the class's <code class="methodname">main</code>
+method to manipulate the table; see the
+<code class="methodname">TableJDBCSeq.main</code> method Javadoc for usage details.
+ </p>
+ <p>
+This <code class="classname">Seq</code> has the following properties:
+ </p>
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem">
+ <p>
+<code class="literal">Table</code>: The name of the sequence number table to use.
+Defaults to <code class="literal">OPENJPA_SEQUENCE_TABLE</code>. If the entities are
+mapped to the same table name but with different schema name within one
+PersistenceUnit, one <code class="literal">OPENJPA_SEQUENCE_TABLE</code> is created
+for each schema.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">PrimaryKeyColumn</code>: The name of the primary key column for the
+sequence table. Defaults to <code class="literal">ID</code>.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">SequenceColumn</code>: The name of the column that will hold the
+current sequence value. Defaults to <code class="literal">SEQUENCE_VALUE</code>.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">Allocate</code>: The number of values to allocate on each database
+trip. Defaults to 50, meaning the class will set aside the next 50 numbers each
+time it accesses the sequence table, which in turn means it only has to make a
+database trip to get new sequence numbers once every 50 sequence number
+requests.
+ </p>
+ </li></ul></div>
+ </li><li class="listitem">
+ <p>
+ <a class="indexterm" name="d5e15784"></a>
+<code class="literal">class-table</code>: This is an alias for the
+<a class="ulink" href="../javadoc/org/apache/openjpa/jdbc/kernel/ClassTableJDBCSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.jdbc.kernel.ClassTableJDBCSeq</code></a>
+. This <code class="classname">Seq</code> is like the <code class="classname">TableJDBCSeq
+</code> above, but maintains a separate table row, and therefore a separate
+sequence number, for each base persistent class. It has all the properties of
+the <code class="classname">TableJDBCSeq</code>. Its table name defaults to <code class="literal">
+OPENJPA_SEQUENCES_TABLE</code>. It also adds the following properties:
+ </p>
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem">
+ <p>
+<code class="literal">IgnoreUnmapped</code>: Whether to ignore unmapped base classes, and
+instead use one row per least-derived mapped class. Defaults to <code class="literal">
+false</code>.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">UseAliases</code>: Whether to use each class' entity name as the
+primary key value of each row, rather than the full class name. Defaults to
+<code class="literal">false</code>.
+ </p>
+ </li></ul></div>
+ <p>
+As with the <code class="classname">TableJDBCSeq</code>, the <code class="classname">
+ClassTableJDBCSeq</code> creates its table automatically during mapping
+tool runs. However, you can manually manipulate the table through the class'
+<code class="methodname">main</code> method. See the Javadoc for the
+<code class="methodname"> ClassTableJDBCSeq.main</code> method for usage details.
+ </p>
+ </li><li class="listitem">
+ <p>
+ <a class="indexterm" name="d5e15810"></a>
+<code class="literal">value-table</code>: This is an alias for the
+<a class="ulink" href="../javadoc/org/apache/openjpa/jdbc/kernel/ValueTableJDBCSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.jdbc.kernel.ValueTableJDBCSeq</code></a>
+. This <code class="classname">Seq</code> is like the <code class="classname">ClassTableJDBCSeq
+</code> above, but has an arbitrary number of rows for sequence values,
+rather than a fixed pattern of one row per class. Its table defaults to
+<code class="literal">OPENJPA_SEQUENCES_TABLE</code>. It has all the properties of the
+<code class="classname">TableJDBCSeq</code>, plus:
+ </p>
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem">
+ <p>
+<code class="literal">PrimaryKeyValue</code>: The primary key value used by this instance.
+ </p>
+ </li></ul></div>
+ <p>
+As with the <code class="classname">TableJDBCSeq</code>, the <code class="classname">
+ValueTableJDBCSeq</code> creates its table automatically during mapping
+tool runs. However, you can manually manipulate the table through the class'
+<code class="methodname">main</code> method. See the Javadoc for the
+<code class="methodname">ValueTableJDBCSeq.main</code> method for usage details.
+ </p>
+ </li><li class="listitem">
+ <p>
+ <a class="indexterm" name="d5e15831"></a>
+<code class="literal">native</code>: This is an alias for the
+<a class="ulink" href="../javadoc/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.jdbc.kernel.NativeJDBCSeq</code></a>.
+Many databases have a concept of "native sequences" - a built-in mechanism for
+obtaining incrementing numbers. For example, in Oracle database, you can create a
+database sequence with a statement like <code class="literal">CREATE SEQUENCE MYSEQUENCE
+</code>. Sequence values can then be atomically obtained and incremented
+with the statement <code class="literal">SELECT MYSEQUENCE.NEXTVAL FROM DUAL</code>.
+OpenJPA provides support for this common mechanism of sequence generation with
+the <code class="classname"> NativeJDBCSeq</code>, which accepts the following
+properties:
+ </p>
+ <div class="itemizedlist"><ul class="itemizedlist" type="circle"><li class="listitem">
+ <p>
+<code class="literal">Sequence</code>: The name of the database sequence. Defaults to
+<code class="literal">OPENJPA_SEQUENCE</code>.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">InitialValue</code>: The initial sequence value. Defaults to 1.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">Increment</code>: The amount the sequence increments. Defaults to 1.
+ </p>
+ </li><li class="listitem">
+ <p>
+<code class="literal">Allocate</code>: The number of values to allocate on each database
+trip. Defaults to 50, meaning the class will set aside the next 50 numbers each
+time it accesses the sequence, which in turn means it only has to make a
+database trip to get new sequence numbers once every 50 sequence number
+requests.
+ </p>
+ </li></ul></div>
+ </li><li class="listitem">
+ <p>
+ <a class="indexterm" name="d5e15856"></a>
+<code class="literal">time</code>: This is an alias for the
+<a class="ulink" href="../javadoc/org/apache/openjpa/kernel/TimeSeededSeq.html" target="_top">
+<code class="classname">org.apache.openjpa.kernel.TimeSeededSeq</code></a>. This
+type uses an in-memory static counter, initialized to the current time in
+milliseconds and monotonically incremented for each value requested. It is only
+suitable for single-JVM environments.
+ </p>
+ </li></ul></div>
+<p>
+You can use JPA <code class="literal">SequenceGenerator</code>s to describe any built-in
+<code class="classname">Seq</code>s or your own <code class="classname">Seq</code>
+implementation. Set the <code class="literal">sequenceName</code> attribute to a plugin
+string describing your choice.
+</p>
+
+<div class="blockquote"><blockquote class="blockquote">
+<p>
+If specifying your own class name, you must include parentheses at the end of
+the class name, even if you have no plugin properties to configure.
+(E.g., <code class="literal">sequenceName="com.example.SeqImpl()"</code>.
+</p>
+</blockquote></div>
+
+<p>
+See <a class="xref" href="jpa_overview_mapping_sequence.html" title="5. Generators">Section 5, “
+ Generators
+ ”</a> in the JPA Overview for
+details on defining <code class="literal">SequenceGenerator</code>s.
+</p>
+
+ <p>
+See <a class="xref" href="ref_guide_conf_plugins.html" title="4. Plugin Configuration">Section 4, “
+ Plugin Configuration
+ ”</a> for plugin string formatting.
+ </p>
+ <div class="example"><a name="ref_guide_sequence_named"></a><p class="title"><b>Example 9.8.
+ Named Seq Sequence
+ </b></p><div class="example-contents">
+
+<pre class="programlisting">
+@Entity
+@Table(name="AUTO")
+public class Author {
+
+ @Id
+ @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="AuthorSeq")
+ @SequenceGenerator(name="AuthorSeq", sequenceName="table(Table=AUTO_SEQ)", allocationSize=100)
+ @Column(name="AID")
+ private long id;
+
+ ...
+}
+</pre>
+ <p>
+Note that if you want to use a plugin string without any arguments, you must
+still suffix the plugin type with <code class="literal">()</code> to differentiate it from
+a sequence name in the <code class="literal">SequenceGenerator.sequenceName</code> attribute:
+ </p>
+<pre class="programlisting">
+@SequenceGenerator(name="AuthorSeq", sequenceName="table()")
+</pre>
+ </div></div><br class="example-break">
+ <p>
+
+OpenJPA maintains a <span class="emphasis"><em>system</em></span> sequence to generate datastore
+identity values for classes that do not declare a specific datastore identity
+strategy. You can configure the system sequence through the
+<a class="link" href="ref_guide_conf_openjpa.html#openjpa.Sequence" title="5.67. openjpa.Sequence"><code class="literal">openjpa.Sequence</code></a>
+configuration property. This property accepts a plugin string describing a
+<code class="classname">Seq</code> instance.
+ </p>
+ <div class="example"><a name="ref_guide_sequence_systemex"></a><p class="title"><b>Example 9.9.
+ System Sequence Configuration
+ </b></p><div class="example-contents">
+
+<pre class="programlisting">
+<property name="openjpa.Sequence" value="time(Increment=100)"/>
+</pre>
+ </div></div><br class="example-break">
+ <p>
+In JPA, set your <code class="literal">GeneratedValue</code> annotation's <code class="literal">
+strategy</code> attribute to <code class="literal">AUTO</code> to use the configured
+system sequence. Or, because <code class="literal">AUTO</code> is the default strategy,
+use the annotation without attributes:
+ </p>
+<pre class="programlisting">
+@GeneratedValue
+private long id;
+</pre>
+ <div class="section" title="6.1. Runtime Access"><div class="titlepage"><div><div><h3 class="title" id="ref_guide_sequence_runtime">6.1.
+ Runtime Access
+ </h3></div></div></div>
+
+ <a class="indexterm" name="d5e15898"></a>
+ <p>
+OpenJPA allows you to access named generators at runtime through the
+<code class="methodname">OpenJPAEntityManager.getNamedGenerator</code> method:
+ </p>
+<pre class="programlisting">
+public Generator getNamedGenerator(String name);
+</pre>
+ <p>
+The returned
+<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/Generator.html" target="_top">
+<code class="classname">org.apache.openjpa.persistence.Generator</code></a> is a
+facade over an internal OpenJPA <code class="classname">Seq</code>.
+ </p>
+ <p>
+The <code class="classname">OpenJPAEntityManager</code> includes additional APIs to
+retrieve the identity generator of any class, or the generator of any field.
+With these APIs, you do not have to know the generator name. Additionally, they
+allow you to access the implicit generator used by default for datastore
+identity classes. See the
+<a class="ulink" href="../javadoc/org/apache/openjpa/persistence/OpenJPAEntityManager.html" target="_top">
+Javadoc</a> for the <code class="methodname"> OpenJPAEntityManager.getIdentityGenerator
+</code> and <code class="methodname">OpenJPAEntityManager.getFieldGenerator
+</code> methods for API details.
+ </p>
+ </div>
+ </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_enterprise_methodql.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_runtime.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_runtime_pm_event.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">5.
+ MethodQL
+ </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 7.
+ Transaction Events
+ </td></tr></table></div></body></html>
\ No newline at end of file
Propchange: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_sequence.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_slice.html
==============================================================================
--- websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_slice.html (added)
+++ websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_slice.html Mon Jun 1 20:19:00 2015
@@ -0,0 +1,50 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Chapter 13. Slice: Distributed Persistence</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.4 User's Guide"><link rel="up" href="ref_guide.html" title="Part 3. Reference Guide"><link rel="prev" href="ref_guide_event.html" title="2. Remote Event Notification Framework"><link rel="next" href="features_and_limitations.html" title="2. Salient Features"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 13.
+ Slice: Distributed Persistence
+ </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_event.html">Prev</a> </td><th width="60%" align="center">Part 3. Reference Guide</th><td width="20%" align="right"> <a accesskey="n" href="features_and_limitations.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 13. Slice: Distributed Persistence" id="ref_guide_slice"><div class="titlepage"><div><div><h2 class="title">Chapter 13.
+ Slice: Distributed Persistence
+ </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="ref_guide_slice.html#slice_overview">1. Overview</a></span></dt><dt><span class="section"><a href="features_and_limitations.html">2. Salient Features</a></span></dt><dd><dl><dt><span class="section"><a href="features_and_limitations.html#d5e16816">2.1. Transparency</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#d5e16822">2.2. Scaling</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#d5e16828">2.3. Distributed Query</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#d5e16851">2.4. Data Distribution</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#d5e16870">2.5. Data Replication</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#d5e16879">2.6. Heterogeneous Database</a></span></dt><dt><span class="section"><a href="features_a
nd_limitations.html#d5e16882">2.7. Distributed Transaction</a></span></dt><dt><span class="section"><a href="features_and_limitations.html#collocation_constraint">2.8. Collocation Constraint</a></span></dt></dl></dd><dt><span class="section"><a href="slice_configuration.html">3. Usage</a></span></dt><dd><dl><dt><span class="section"><a href="slice_configuration.html#d5e16899">3.1. How to activate Slice Runtime?</a></span></dt><dt><span class="section"><a href="slice_configuration.html#d5e16903">3.2. How to configure each database slice?</a></span></dt><dt><span class="section"><a href="slice_configuration.html#distribution_policy">3.3. Implement DistributionPolicy interface</a></span></dt><dt><span class="section"><a href="slice_configuration.html#replication_policy">3.4. Implement ReplicationPolicy interface</a></span></dt></dl></dd><dt><span class="section"><a href="ch29s04.html">4. Configuration Properties</a></span></dt><dd><dl><dt><span class="section"><a href="ch29s04.html#d5e
16962">4.1. Global Properties</a></span></dt><dd><dl><dt><span class="section"><a href="ch29s04.html#d5e16964">4.1.1. openjpa.slice.DistributionPolicy</a></span></dt><dt><span class="section"><a href="ch29s04.html#d5e16970">4.1.2. openjpa.slice.Lenient</a></span></dt><dt><span class="section"><a href="ch29s04.html#d5e16977">4.1.3. openjpa.slice.Master</a></span></dt><dt><span class="section"><a href="ch29s04.html#d5e16985">4.1.4. openjpa.slice.Names</a></span></dt><dt><span class="section"><a href="ch29s04.html#d5e16993">4.1.5. openjpa.slice.ThreadingPolicy</a></span></dt><dt><span class="section"><a href="ch29s04.html#d5e17019">4.1.6. openjpa.slice.TransactionPolicy</a></span></dt></dl></dd><dt><span class="section"><a href="ch29s04.html#d5e17037">4.2. Per-Slice Properties</a></span></dt></dl></dd></dl></div>
+
+ <p>
+ The standard JPA runtime environment works with a <span class="emphasis"><em>single</em></span>
+ database instance. <span class="emphasis"><em>Slice</em></span> is a plug-in module for OpenJPA
+ to work with <span class="emphasis"><em>multiple</em></span> databases within the same
+ transaction. Following sections describe the features and usage of Slice for
+ distributed database environment.
+ </p>
+
+ <div class="section" title="1. Overview"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="slice_overview">1. Overview</h2></div></div></div>
+
+ <p>
+ Enterprise applications are increasingly deployed in distributed database
+ environment. A distributed, horizontally-partitioned
+ database environment can be an effective scaling strategy for growing data
+ volume, to support multiple clients on a multi-tenant hosting platform and
+ many other practical scenarios that can benefit from data partitioning.
+ </p>
+
+ <p>
+ Any JPA-based user application has to address demanding technical and
+ conceptual challenges to interact with multiple physical databases
+ within a single transaction.
+ OpenJPA Slice encapsulates the complexity of distributed database environment
+ via the abstraction of <span class="emphasis"><em>virtual</em></span> database which internally
+ manages multiple physical database instances referred
+ as <span class="emphasis"><em>slice</em></span>.
+ <span class="emphasis"><em>Virtualization</em></span> of distributed databases makes OpenJPA
+ object management kernel and the user application to work in the same way as
+ in the case of a single physical database.
+ </p>
+ </div>
+
+
+
+
+
+
+
+
+</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_event.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="features_and_limitations.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.
+ Remote Event Notification Framework
+ </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 2. Salient Features</td></tr></table></div></body></html>
\ No newline at end of file
Propchange: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/ref_guide_slice.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/slice_configuration.html
==============================================================================
--- websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/slice_configuration.html (added)
+++ websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/slice_configuration.html Mon Jun 1 20:19:00 2015
@@ -0,0 +1,177 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>3. Usage</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.4 User's Guide"><link rel="up" href="ref_guide_slice.html" title="Chapter 13. Slice: Distributed Persistence"><link rel="prev" href="features_and_limitations.html" title="2. Salient Features"><link rel="next" href="ch29s04.html" title="4. Configuration Properties"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3. Usage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="features_and_limitations.html">Prev</a> </td><th width="60%" align="center">Chapter 13.
+ Slice: Distributed Persistence
+ </th><td width="20%" align="right"> <a accesskey="n" href="ch29s04.html">Next</a></td></tr></table><hr></div><div class="section" title="3. Usage"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="slice_configuration">3. Usage</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="slice_configuration.html#d5e16899">3.1. How to activate Slice Runtime?</a></span></dt><dt><span class="section"><a href="slice_configuration.html#d5e16903">3.2. How to configure each database slice?</a></span></dt><dt><span class="section"><a href="slice_configuration.html#distribution_policy">3.3. Implement DistributionPolicy interface</a></span></dt><dt><span class="section"><a href="slice_configuration.html#replication_policy">3.4. Implement ReplicationPolicy interface</a></span></dt></dl></div>
+
+ <p>
+ Slice is activated via the following property settings:
+ </p>
+ <div class="section" title="3.1. How to activate Slice Runtime?"><div class="titlepage"><div><div><h3 class="title" id="d5e16899">3.1. How to activate Slice Runtime?</h3></div></div></div>
+
+ <p>
+ The basic configuration property is
+ </p><pre class="programlisting">
+ <property name="openjpa.BrokerFactory" value="slice"/>
+ </pre><p>
+ This critical configuration activates a specialized object management
+ kernel that can work against multiple databases.
+ </p>
+ </div>
+
+ <div class="section" title="3.2. How to configure each database slice?"><div class="titlepage"><div><div><h3 class="title" id="d5e16903">3.2. How to configure each database slice?</h3></div></div></div>
+
+ <p>
+ Each database slice is identified by a logical name unique within a
+ persistent unit. The list of the slices is specified by
+ <code class="classname">openjpa.slice.Names</code> property.
+ For example, specify three slices named <code class="classname">"One"</code>,
+ <code class="classname">"Two"</code> and <code class="classname">"Three"</code> as follows:
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.Names" value="One, Two, Three"/>
+ </pre><p>
+ </p>
+ <p>
+ This property is not mandatory. If this property is not specified then
+ the configuration is scanned for logical slice names. Any property
+ <code class="classname">"abc"</code> of the form <code class="classname">openjpa.slice.XYZ.abc</code> will
+ register a slice with logical
+ name <code class="classname">"XYZ"</code>.
+ </p>
+ <p>
+ The order of the names is significant when no <code class="classname">openjpa.slice.Master</code>
+ property is not specified. The persistence unit is then scanned to find
+ all configured slice names and they are ordered alphabetically.
+ </p>
+
+ <p>
+ Each database slice properties can be configured independently.
+ For example, the
+ following configuration will register two slices with logical name
+ <code class="classname">One</code> and <code class="classname">Two</code>.
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.One.ConnectionURL" value="jdbc:mysql:localhost//slice1"/>
+ <property name="openjpa.slice.Two.ConnectionURL" value="jdbc:mysql:localhost//slice2"/>
+ </pre><p>
+ </p>
+
+ <p>
+ Any OpenJPA specific property can be configured per slice basis.
+ For example, the following configuration will use two different JDBC
+ drivers for slice <code class="classname">One</code> and <code class="classname">Two</code>.
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
+ <property name="openjpa.slice.Two.ConnectionDriverName" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
+ </pre><p>
+ </p>
+
+ <p>
+ Any property if unspecified for a particular slice will be defaulted by
+ corresponding OpenJPA property. For example, consider following three slices
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.One.ConnectionURL" value="jdbc:mysql:localhost//slice1"/>
+ <property name="openjpa.slice.Two.ConnectionURL" value="jdbc:mysql:localhost//slice2"/>
+ <property name="openjpa.slice.Three.ConnectionURL" value="jdbc:oracle:localhost//slice3"/>
+
+ <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/>
+ <property name="openjpa.slice.Three.ConnectionDriverName" value="oracle.jdbc.Driver"/>
+ </pre><p>
+ In this example, <code class="classname">Three</code> will use slice-specific
+ <code class="classname">oracle.jdbc.Driver</code> driver while slice
+ <code class="classname">One</code> and <code class="classname">Two</code> will use
+ the driver <code class="classname">com.mysql.jdbc.Driver</code> as
+ specified by <code class="classname">openjpa.ConnectionDriverName</code>
+ property value.
+ </p>
+
+ <p>
+ A connection pool may also be used with Slice by using the <code class="literal">openjpa.ConnectionProperties</code> property.
+ For example to use commons-dbcp with Derby you might use the following properties :
+ </p><pre class="programlisting">
+ <property name="openjpa.BrokerFactory" value="slice"/>
+ <property name="openjpa.ConnectionDriverName" value="org.apache.commons.dbcp.BasicDataSource"/>
+ <property name="openjpa.slice.Names" value="One,Two"/>
+ <property name="openjpa.slice.Master" value="Two"/>
+
+ <property name="openjpa.slice.One.ConnectionProperties" value="Url=jdbc:derby:target/database/openjpa-slice1;create=true, DriverClassName=org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="openjpa.slice.Two.ConnectionProperties" value="Url=jdbc:derby:target/database/openjpa-slice2;create=true, DriverClassName=org.apache.derby.jdbc.EmbeddedDriver"/>
+
+ <property name="openjpa.jdbc.DBDictionary" value="derby"/>
+ </pre><p>
+ </p><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
+ <p>
+ Be aware that you need to set the DBDictionary when using commons-dbcp.
+ </p>
+ </div><p>
+ </p>
+ </div>
+
+ <div class="section" title="3.3. Implement DistributionPolicy interface"><div class="titlepage"><div><div><h3 class="title" id="distribution_policy">3.3. Implement DistributionPolicy interface</h3></div></div></div>
+
+ <p>
+ Slice needs to determine which slice will persist a new instance.
+ The application can only decide this policy (for example,
+ all PurchaseOrders before April 30 goes to slice <code class="classname">One</code>,
+ all the rest goes to slice <code class="classname">Two</code>). This is why
+ the application has to implement
+ <code class="classname">org.apache.openjpa.slice.DistributionPolicy</code> and
+ specify the implementation class in configuration
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.DistributionPolicy" value="com.acme.foo.MyOptimialDistributionPolicy"/>
+ </pre><p>
+ </p>
+
+ <p>
+ The interface <code class="classname">org.apache.openjpa.slice.DistributionPolicy</code>
+ is simple with a single method. The complete listing of the
+ documented interface follows:
+ </p><pre class="programlisting">
+
+public interface DistributionPolicy {
+ /**
+ * Gets the name of the slice where a given instance will be stored.
+ *
+ * @param pc The newly persistent or to-be-merged object.
+ * @param slices name of the configured slices.
+ * @param context persistence context managing the given instance.
+ *
+ * @return identifier of the slice. This name must match one of the
+ * configured slice names.
+ * @see DistributedConfiguration#getSliceNames()
+ */
+ String distribute(Object pc, List<String> slices, Object context);
+}
+
+ </pre><p>
+ </p>
+
+ <p>
+ While implementing a distribution policy the most important thing to
+ remember is <a class="link" href="features_and_limitations.html#collocation_constraint" title="2.8. Collocation Constraint">collocation constraint</a>.
+ Because Slice can not establish or query any cross-database relationship, all the
+ related instances must be stored in the same database slice.
+
+ Slice can determine the closure of a root object by traversal of
+ cascaded relationships. Hence user-defined policy has to only decide the
+ database for the root instance that is the explicit argument to
+ <code class="methodname">EntityManager.persist()</code> call.
+ Slice will ensure that all other related instances that get persisted by cascade
+ are assigned to the same database slice as that of the root instance.
+ However, the user-defined distribution policy must return the
+ same slice identifier for the instances that are logically related but
+ not cascaded for persist.
+ </p>
+ </div>
+
+ <div class="section" title="3.4. Implement ReplicationPolicy interface"><div class="titlepage"><div><div><h3 class="title" id="replication_policy">3.4. Implement ReplicationPolicy interface</h3></div></div></div>
+
+ <p>
+ The entities that are enumerated in <code class="classname">openjpa.slice.ReplicatedTypes</code>
+ property can be stored in multiple slices as identical copies.
+ Specify the implementation class of <code class="classname">ReplicationPolicy</code> in configuration as
+ </p><pre class="programlisting">
+ <property name="openjpa.slice.ReplicationPolicy" value="com.acme.foo.MyReplicationPolicy"/>
+ </pre><p>
+ </p>
+ </div>
+ </div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="features_and_limitations.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_slice.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch29s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2. Salient Features </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 4. Configuration Properties</td></tr></table></div></body></html>
\ No newline at end of file
Propchange: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/slice_configuration.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/supported_databases.html
==============================================================================
--- websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/supported_databases.html (added)
+++ websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/supported_databases.html Mon Jun 1 20:19:00 2015
@@ -0,0 +1,152 @@
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+ <title>Appendix 2. Supported Databases</title><base href="display"><link rel="stylesheet" type="text/css" href="css/docbook.css"><meta name="generator" content="DocBook XSL-NS Stylesheets V1.76.1"><link rel="home" href="manual.html" title="Apache OpenJPA 2.4 User's Guide"><link rel="up" href="appendices.html" title="Part 4. Appendices"><link rel="prev" href="jpa_resources.html" title="Appendix 1. JPA Resources"><link rel="next" href="dbsupport.html" title="2. Verified Database Matrix"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Appendix 2.
+ Supported Databases
+ </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="jpa_resources.html">Prev</a> </td><th width="60%" align="center">Part 4. Appendices</th><td width="20%" align="right"> <a accesskey="n" href="dbsupport.html">Next</a></td></tr></table><hr></div><div class="appendix" title="Appendix 2. Supported Databases" id="supported_databases"><div class="titlepage"><div><div><h2 class="title">Appendix 2.
+ Supported Databases
+ </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="supported_databases.html#dbappendix">1.
+ Overview
+ </a></span></dt><dt><span class="section"><a href="dbsupport.html">2.
+ Verified Database Matrix
+ </a></span></dt><dt><span class="section"><a href="dbcompatible.html">3.
+ Compatible Database Matrix
+ </a></span></dt><dt><span class="section"><a href="dbunverified.html">4.
+ Unverified Database Matrix
+ </a></span></dt><dt><span class="section"><a href="dbsupport_derby.html">5.
+ Apache Derby
+ </a></span></dt><dt><span class="section"><a href="dbsupport_interbase.html">6.
+ Borland Interbase
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_interbase.html#dbsupport_interbase_issues">6.1.
+ Known issues with Interbase
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_jdatastore.html">7.
+ JDataStore
+ </a></span></dt><dt><span class="section"><a href="dbsupport_db2.html">8.
+ IBM DB2
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_db2.html#dbsupport_db2_issues">8.1.
+ Known issues with DB2
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_empress.html">9.
+ Empress
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_empress.html#dbsupport_empress_issues">9.1.
+ Known issues with Empress
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_h2.html">10.
+ H2 Database Engine
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_h2.html#dbsupport_h2_issues">10.1.
+ Known issues with H2 Database Engine
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_hypersonic.html">11.
+ Hypersonic
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_hypersonic.html#dbsupport_hypersonic_issues">11.1.
+ Known issues with Hypersonic
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_firebird.html">12.
+ Firebird
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_firebird.html#dbsupport_firebird_issues">12.1.
+ Known issues with Firebird
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_informix.html">13.
+ Informix
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_informix.html#dbsupport_informix_issues">13.1.
+ Known issues with Informix
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_ingres.html">14.
+ Ingres Database
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_ingres.html#dbsupport_ingres_issues">14.1.
+ Known issues with Ingres
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_intersystems_cache.html">15.
+ InterSystems Cache
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_intersystems_cache.html#dbsupport_intersystems_cache_issues">15.1.
+ Known issues with InterSystems Cache
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_access.html">16.
+ Microsoft Access
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_access.html#dbsupport_access_issues">16.1.
+ Known issues with Microsoft Access
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_sqlserver.html">17.
+ Microsoft SQL Server
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_sqlserver.html#dbsupport_sqlserver_issues">17.1.
+ Known issues with SQL Server
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_foxpro.html">18.
+ Microsoft FoxPro
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_foxpro.html#dbsupport_foxpro_issues">18.1.
+ Known issues with Microsoft FoxPro
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_mysql.html">19.
+ MySQL
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_mysql.html#dbsupport_mysql_query_hints">19.1.
+ Using Query Hints with MySQL
+ </a></span></dt><dt><span class="section"><a href="dbsupport_mysql.html#dbsupport_mysql_issues">19.2.
+ Known issues with MySQL
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_oracle.html">20.
+ Oracle
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_oracle.html#dbsupport_oracle_query_hints">20.1.
+ Using Query Hints with Oracle
+ </a></span></dt><dt><span class="section"><a href="dbsupport_oracle.html#dbsupport_oracle_issues">20.2.
+ Known issues with Oracle
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_pointbase.html">21.
+ Pointbase
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_pointbase.html#dbsupport_pointbase_issues">21.1.
+ Known issues with Pointbase
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_postgresql.html">22.
+ PostgreSQL
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_postgresql.html#dbsupport_postgresql_issues">22.1.
+ Known issues with PostgreSQL
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_soliddb.html">23.
+ IBM solidDB
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_soliddb.html#dbsupport_soliddb_table_types">23.1.
+ M-type tables vs. D-type tables
+ </a></span></dt><dt><span class="section"><a href="dbsupport_soliddb.html#dbsupport_soliddb_concurrency_control">23.2.
+ Concurrency control mechanism
+ </a></span></dt></dl></dd><dt><span class="section"><a href="dbsupport_sybase.html">24.
+ Sybase Adaptive Server
+ </a></span></dt><dd><dl><dt><span class="section"><a href="dbsupport_sybase.html#dbsupport_sybase_issues">24.1.
+ Known issues with Sybase
+ </a></span></dt></dl></dd></dl></div>
+
+
+ <div class="section" title="1. Overview"><div class="titlepage"><div><div><h2 class="title" style="clear: both" id="dbappendix">1.
+ Overview
+ </h2></div></div></div>
+
+ <p>
+The following appendix covers the database and JDBC driver versions that are
+known to work with OpenJPA, along with any database specific configuration
+parameters, known issues or limitations.
+The <a class="link" href="dbsupport.html" title="2. Verified Database Matrix">Verified Database Matrix</a>, contains the
+list of databases and drivers that were tested extensively against this
+release of OpenJPA, while the <a class="link" href="dbcompatible.html" title="3. Compatible Database Matrix">Compatible Database
+Matrix</a> contains the list of databases and drivers that were tested
+against prior releases or by OpenJPA users and may not support every feature
+of this release.
+
+The Unverified Database Matrix contains a
+list of databases which have been reported to work, but have not been tested by
+the development team.
+ </p>
+ </div>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+</div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="jpa_resources.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="appendices.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dbsupport.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Appendix 1.
+ JPA Resources
+ </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 2.
+ Verified Database Matrix
+ </td></tr></table></div></body></html>
\ No newline at end of file
Propchange: websites/production/openjpa/content/builds/2.4.0/apache-openjpa/docs/supported_databases.html
------------------------------------------------------------------------------
svn:eol-style = native