Author: buildbot
Date: Mon Jun 2 08:24:49 2014
New Revision: 910885
Log:
Staging update by buildbot for isis
Added:
websites/staging/isis/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.html
Modified:
websites/staging/isis/trunk/cgi-bin/ (props changed)
websites/staging/isis/trunk/content/ (props changed)
websites/staging/isis/trunk/content/documentation.html
Propchange: websites/staging/isis/trunk/cgi-bin/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jun 2 08:24:49 2014
@@ -1 +1 @@
-1599093
+1599119
Propchange: websites/staging/isis/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jun 2 08:24:49 2014
@@ -1 +1 @@
-1599093
+1599119
Added:
websites/staging/isis/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.html
==============================================================================
---
websites/staging/isis/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.html
(added)
+++
websites/staging/isis/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.html
Mon Jun 2 08:24:49 2014
@@ -0,0 +1,556 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+
+ <meta charset="utf-8">
+ <title>Disabling Persistence by Reachability</title>
+ <meta name="description" content="">
+ <meta name="author" content="">
+
+ <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
+ <!--[if lt IE 9]>
+ <script
src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+
+
+ <!-- Le styles -->
+ <link href="./../../../bootstrap-3.0.0/css/bootstrap.css" rel="stylesheet">
+ <link href="./../../../prettify.css" rel="stylesheet">
+
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ }
+ .sprite {
+ display: inline-block;
+ height: 20px;
+ margin: 0 auto 4px;
+ outline: medium none;
+ text-indent: -999em;
+ width: 24px;
+ background-image: url('./../../../images/sprites.png');
+ background-repeat: no-repeat;
+ overflow: hidden;
+ cursor: pointer;
+ }
+ .edit-page {
+ display: inline-block;
+ height: 20px;
+ margin: 0 auto 4px;
+ outline: medium none;
+ text-indent: -999em;
+ width: 24px;
+ background-image: url('./../../../images/edit.png');
+ background-repeat: no-repeat;
+ overflow: hidden;
+ cursor: pointer;
+ }
+ .fb-share {
+ background-position: 0px -40px;
+ }
+ .gp-share {
+ background-position: 0px 0px;
+ }
+ .tw-share {
+ background-position: 0px -80px;
+ }
+ .markdown-content {
+ min-height: 500px;
+ }
+ .book-image img {
+ border: 1px;
+ border-style: solid;
+ }
+ .release-matrix .heading {
+ background-color: #eeeeee;
+ }
+ .release-matrix .new {
+ color: #dd0000;
+ font-weight: bolder;
+ }
+ .stub,.note {
+ position: relative;
+ padding: 7px 15px;
+ margin-bottom: 18px;
+ color: #404040;
+ background-color: #eedc94;
+ background-repeat: repeat-x;
+ background-image: -khtml-gradient(linear, left top, left bottom,
from(#fceec1), to(#eedc94));
+ background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
+ background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
+ background-image: -webkit-gradient(linear, left top, left bottom,
color-stop(0%, #fceec1), color-stop(100%, #eedc94));
+ background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
+ background-image: -o-linear-gradient(top, #fceec1, #eedc94);
+ background-image: linear-gradient(top, #fceec1, #eedc94);
+ filter:
progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1',
endColorstr='#eedc94', GradientType=0);
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
+ border-color: #eedc94 #eedc94 #e4c652;
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0,
0.25);
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
+ border-width: 1px;
+ border-style: solid;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+ -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+ }
+
+ div.XXXisis-tweak form {
+ margin-top: 6px;
+ margin-bottom: -2px;
+ }
+
+ div.row div.col-md-12 {
+ border-top: 1px solid #eeeeee;
+ }
+
+
+ /* Isis specific stuff */
+
+ div.row div.col-md-12 {
+ margin-top: 20px;
+ }
+
+ .container {
+ width: 940px;
+ }
+
+ .markdown-content .documentation .span-one-third p {
+ margin-bottom: 0px;
+ }
+
+ .container .markdown-content .group,
+ .markdown-content .documentation .group {
+ margin-top: 9px;
+ }
+
+ .container .group h2,
+ .documentation .group h2 {
+ border-bottom: 1px solid #DDD
+ }
+
+ .container h2 a[name],
+ .documentation h2 a[name] {
+ padding-top: 50px;
+ margin-top: -50px;
+ }
+
+ .container h2 a[name],
+ .container h3 a[name],
+ .container h4 a[name],
+ .documentation h2 a[name],
+ .documentation h3 a[name],
+ .documentation h4 a[name] {
+ color: black;
+ display: inline-block;
+ }
+ .container h2 a[name]:hover,
+ .container h3 a[name]:hover,
+ .container h4 a[name]:hover,
+ .documentation h2 a[name]:hover,
+ .documentation h3 a[name]:hover,
+ .documentation h4 a[name]:hover {
+ text-decoration: none;
+ }
+
+ .documentation h2 a:not([name]),
+ .documentation h3 a:not([name]),
+ .documentation h4 a:not([name]) {
+ /* same as code style */
+ padding: 0 3px 2px;
+ font-family: Monaco, Andale Mono, Courier New, monospace;
+ font-size: 12px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ padding: 1px 3px;
+ }
+
+ .carousel-indicators li {
+ border: 1px solid rgb(192,70,1);
+ }
+
+ .carousel-indicators li.active {
+ background-color: rgb(192,70,1);
+ }
+
+ .carousel-control .icon-prev,
+ .carousel-control .icon-next {
+ color: rgb(192,70,1);
+ font-size: 60px;
+ }
+
+ .page-header {
+ margin-top: 0px;
+ }
+
+ .container blockquote p {
+ font-size: small;
+ }
+
+ .container blockquote p:not([author]) {
+ font-style: italic;
+ }
+
+ .container blockquote p {
+ font-size: small;
+ font-style: italic;
+ font-weight: bold;
+ }
+
+ footer hr {
+ margin-top: 100px;
+ }
+
+ .markdown-content img {
+ margin-top: 10px;
+ margin-bottom: 20px;
+ }
+
+ .markdown-content a img {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+
+
+ #forkongithub a{
+ display: none;
+ background:#090;
+ color:#fff;
+ text-decoration:none;
+ font-family:arial, sans-serif;
+ text-align:center;
+ font-weight:bold;
+ padding:5px 40px;
+ font-size:1rem;
+ line-height:2rem;
+ position:relative;
+ transition:0.5s;
+ }
+ #forkongithub a:hover{
+ background:#0D0;
+ color:#fff;
+ }
+ #forkongithub a::before,
+ #forkongithub a::after{
+ content:"";width:100%;
+ display:block;
+ position:fixed;
+ top:1px;
+ left:0;
+ height:1px;
+ background:#fff;
+ z-index: 9999;
+ }
+ #forkongithub a::after{
+ bottom:1px;
+ top:auto;
+ }
+ @media screen and (min-width:768px){
+ #forkongithub{
+ position:fixed;
+ display:block;
+ top:0;
+ right:0;
+ width:250px;
+ overflow:hidden;
+ height:250px;
+ z-index: 9999;
+ }
+ #forkongithub a{
+ display:inherit;
+ width:250px;
+ position:fixed;
+ font-size:small;
+ top:40px;
+ right:-60px;
+ transform:rotate(45deg);
+ -webkit-transform:rotate(45deg);
+ box-shadow:4px 4px 10px rgba(0,0,0,0.8);
+ }
+ }
+ </style>
+
+ <!-- courtesy of http://codepo8.github.io/css-fork-on-github-ribbon/ -->
+ <span id="forkongithub">
+ <a href="https://github.com/apache/isis">Fork me on GitHub</a>
+ </span>
+
+ <script type="text/javascript">
+ function fbshare () {
+ window.open(
+ "http://www.facebook.com/sharer/sharer.php?u="+document.URL,
+ 'Share on Facebook',
+ 'width=640,height=426');
+ };
+ function gpshare () {
+ window.open(
+ "https://plus.google.com/share?url="+document.URL,
+ 'Share on Google+',
+ 'width=584,height=385');
+ };
+ function twshare () {
+ window.open(
+
"https://twitter.com/intent/tweet?url="+document.URL+"&text=Disabling
Persistence by Reachability",
+ 'Share on Twitter',
+ 'width=800,height=526');
+ };
+ </script>
+
+ <!-- Le fav and touch icons -->
+ <link rel="shortcut icon" href="./../../../images/favicon.ico">
+
+ <script src="./../../../javascript/prettify.js"
type="text/javascript"></script>
+
+ <script src="//code.jquery.com/jquery.js"></script>
+ <script src="./../../../javascript/prettyprint.js"></script>
+ <script src="./../../../bootstrap-3.0.0/js/bootstrap.js"></script>
+
+
+ <script src="http://platform.twitter.com/widgets.js"
type="text/javascript"></script>
+ <!--
+ <DISABLEDscript src="./../../../javascript/common.js"></DISABLEDscript>
+ -->
+
+
+
+
+
+ <script>
+ $(function () { prettyPrint() })
+ $().dropdown()
+ </script>
+
+
+ </head>
+
+ <body>
+
+ <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
+ <div class="container">
+ <a class="navbar-brand" href="./../../../index.html">Apache
Isis™</a>
+ <ul class="nav navbar-nav">
+ <li><a href="./../../../download.html">Download</a></li>
+ <li><a href="./../../../documentation.html">Documentation</a></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown">Screenshots<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a
href="./../../../intro/elevator-pitch/isis-in-pictures.html">Screenshots</a></li>
+ <li><a
href="./../../../intro/tutorials/screencasts.html">Screencasts <img
src="./../../../images/tv_show-25.png"></a></li>
+ <li><a
href="./../../../intro/powered-by/powered-by.html">Powered by</a></li>
+ <li><a href="http://isisdemo.mmyco.co.uk/">Online Demo</a></li>
+ </ul>
+ </li>
+
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle"
data-toggle="dropdown">Support<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="./../../../support.html">Mailing Lists</a></li>
+ <li><a href="http://isis.markmail.org/search/?q=">ML
Archives</a></li>
+ <li><a
href="https://issues.apache.org/jira/browse/ISIS">JIRA</a></li>
+ <li><a
href="http://stackoverflow.com/questions/tagged/isis">Stack Overflow</a></li>
+ <li><a href="http://github.com/apache/isis">Github
mirror</a></li>
+ </ul>
+ </li>
+
+ <FORM class="navbar-form navbar-right"
id="searchbox_012614087480249044419:dn-q5gtwxya"
action="http://www.google.com/cse">
+ <div class="form-group">
+ <input type="hidden" name="cx"
value="012614087480249044419:dn-q5gtwxya">
+ <INPUT type="hidden" name="cof" value="FORID:0">
+ <INPUT class="form-control" name="q" type="text"
placeholder="Search">
+ </div>
+ </FORM>
+
+ <li class="dropdown navbar-right">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Apache
<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li>
+ <a href="http://www.apache.org/">Apache Homepage <i
class="icon-share-alt"></i></a>
+ </li>
+ <li>
+ <a href="http://www.apache.org/licenses/">Licenses <i
class="icon-share-alt"></i></a>
+ </li>
+ <li>
+ <a href="http://www.apache.org/security/">Security <i
class="icon-share-alt"></i></a>
+ </li>
+ <li>
+ <a
href="http://www.apache.org/foundation/sponsorship.html">Sponsorship <i
class="icon-share-alt"></i></a>
+ </li>
+ <li>
+ <a href="http://www.apache.org/foundation/thanks.html">Thanks
<i class="icon-share-alt"></i></a>
+ </li>
+ <li>
+ <a href="./../../../more-thanks.html">More thanks <i
class="icon-share-alt"></i></a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+
+ </div>
+ </nav>
+
+ <div class="container">
+ <div class="markdown-content">
+
+
+<div class="page-header">
+<p><a href="./../../../documentation.html">Docs</a> » <a
href="./../../../components/about.html">Components</a> » <a
href="./../../../components/objectstores/about.html">Objectstores</a> » <a
href="./../../../components/objectstores/jdo/about.html">Jdo</a></p>
+<h1>Disabling Persistence by Reachability
+
+</h1>
+</div>
+
+<p>JDO/DataNucleus supports the concept of <a
href="http://www.datanucleus.org/products/datanucleus/jdo/orm/cascading.html">persistence-by-reachability</a>.
That is, if
+a non-persistent entity is associated with an already-persistent entity, then
DataNucleus will detect this and will automatically persist the associated
object.</p>
+
+<p>Put another way: there is no need to call Isis'
<code>DomainObjectContainer#persist(.)</code> or
<code>DomainObjectContainer#persistIfNotAlready(.)</code> methods.</p>
+
+<p>However, convenient though this feature is, you may find that it causes
performance issues.</p>
+
+<p>One scenario in particular where this performance issues can arise is if
your entities implement the <code>java.lang.Comparable</code> interface, and
you have used Isis' <a
href="../../../reference/Utility.html">ObjectContracts</a> utility. The issue
here is that <code>ObjectContracts</code> implementation can cause DataNucleus
to recursively rehydrate a larger number of associated entities. (More detail
below).</p>
+
+<p>To disable persistence-by-reachability, add the following to
<code>persistor_datanucleus.properties</code>:</p>
+
+<pre><code>#
+# Require explicit persistence (since entities are Comparable and using
ObjectContracts#compareTo).
+#
+isis.persistor.datanucleus.impl.datanucleus.persistenceByReachabilityAtCommit=false
+</code></pre>
+
+<p>This change has been made to the <a
href="../../../intro/getting-started/simple-archetype.html">simple</a> and <a
href="../../../intro/getting-started/quickstart-archetype.html">quickstart</a>
archetypes (1.5.0-snapshot).</p>
+
+<h4>Explanation of the issue in more detail</h4>
+
+<p>Consider the entities:</p>
+
+<pre><code>Party <->* AgreementRole <*-> Agreement
+</code></pre>
+
+<p>In the course of a transaction, the <code>Agreement</code> entity is loaded
into memory (not necessarily modified), and then new
<code>AgreementRole</code>s are associated to it.</p>
+
+<p>All these entities implement <code>Comparable</code> using
<code>ObjectContracts</code>, and the implementation of AgreementRole's
(simplified) is:</p>
+
+<pre><code>public class AgreementRole {
+ ...
+ public int compareTo(AgreementRole other) {
+ return ObjectContracts.compareTo(this, other, "agreement, startDate,
party");
+ }
+ ...
+}
+</code></pre>
+
+<p>while Agreement's is implemented as:</p>
+
+<pre><code>public class Agreement {
+ ...
+ public int compareTo(Agreement other) {
+ return ObjectContracts.compareTo(this, other, "reference");
+ }
+ ...
+}
+</code></pre>
+
+<p>and Party's is similarly implemented as: </p>
+
+<pre><code>public class Party {
+ ...
+ public int compareTo(Party other) {
+ return ObjectContracts.compareTo(this, other, "reference");
+ }
+ ...
+}
+</code></pre>
+
+<p>DataNucleus's persistence-by-reachability algorithm adds the
<code>AgreementRole</code>s into a <code>SortedSet</code>, which causes
<code>AgreementRole#compareTo()</code> to fire:
+* the evaluation of the "agreement" property delegates back to the
<code>Agreement</code>, whose own <code>Agreement#compareTo()</code> uses the
scalar <code>reference</code> property. As the <code>Agreement</code> is
already in-memory, this does not trigger any further database queries
+* the evaluation of the "startDate" property is just a scalar
+* the evaluation of the "party" property delegates back to the
<code>Party</code>, whose own <code>Party#compareTo()</code> requires the uses
the scalar <code>reference</code> property. However, since the
<code>Party</code> is not yet in-memory, using the <code>reference</code>
property triggers a database query to "rehydrate" the <code>Party</code>
instance.</p>
+
+<p>In other words, in figuring out whether <code>AgreementRole</code> requires
the persistence-by-reachability algorithm to run, it causes the adjacent
associated entity <code>Party</code> to also be retrieved.</p>
+
+<p>, in order to compare evaluating a property that references another
entity, causes any rehydration of that associate entity. <br />
+, which </p>
+
+<p>Sometimes you just need to see what is going on. There are various ways in
which logging can be enabled, here are some ideas.</p>
+
+<h3>In Apache Isis</h3>
+
+<p>Modify <code>WEB-INF/logging.properties</code> (a log4j config file)</p>
+
+<h3>In DataNucleus</h3>
+
+<p>As per the <a
href="http://www.datanucleus.org/products/accessplatform/logging.html">DN
logging page</a></p>
+
+<h3>In the JDBC Driver</h3>
+
+<p>Configure log4jdbc JDBC rather than the vanilla driver (see
<code>WEB-INF/persistor_datanucleus.properties</code>) and configure log4j
logging (see <code>WEB-INF/logging.properties</code>).</p>
+
+<p>There are examples of both in the quickstart archetype.</p>
+
+<h3>In the Database</h3>
+
+<h4>HSQLDB Logging</h4>
+
+<p>Add <code>;sqllog=3</code> to the end of the JDBC URL.</p>
+
+<h4>PostgreSQL Logging</h4>
+
+<p>In <code>postgresql\9.2\data\postgresql.conf</code>:</p>
+
+<pre>
+log_statement = 'all'
+</pre>
+
+<p>Will then log to <code>postgresql\9.2\data\pg_log</code> directory.</p>
+
+<p>Note that you must restart the service for this to be picked up.</p>
+
+<h4>MS SQL Server Logging</h4>
+
+<p>Use the excellent SQL Profiler tool.</p>
+
+
+
+ </div>
+
+ <div id="edit" class="modal hide fade in" style="xxxdisplay: none; ">
+ <div class="modal-header">
+ <a class="close" data-dismiss="modal">x</a>
+
+ <h3>Thank you for contributing to the documention!</h3>
+ </div>
+ <div class="modal-body">
+ <h4>Any help with the documentation is greatly
appreciated.</h4>
+ <p>All edits are reviewed before going live, so feel free to
do much more than fix typos or links. If you see a page that could benefit
from an entire rewrite, we'd be thrilled to review it. Don't be surprised if
we like it so much we ask you for help with other pages :)</p>
+ <small>NOTICE: unless indicated otherwise on the pages in
question, all editable content available from apache.org is presumed to be
licensed under the Apache License (AL) version 2.0 and hence all submissions to
apache.org treated as formal Contributions under the license terms.</small>
+ <!--[if gt IE 6]>
+ <h4>Internet Explorer Users</h4>
+ <p>If you are not an Apache committer, click the Yes link and
enter a <i>anonymous</i> for the username and leave the password empty</p>
+ <![endif]-->
+
+ </div>
+ <div class="modal-footer">
+ Do you have an Apache ID?
+ <a
href="javascript:void(location.href='https://cms.apache.org/redirect?uri='+escape(location.href))"
class="btn">Yes</a>
+ <a
href="javascript:void(location.href='https://anonymous:@cms.apache.org/redirect?uri='+escape(location.href))"
class="btn">No</a>
+ </div>
+ </div>
+ <!--
+ <script src="./../../../javascript/bootstrap-modal.js"></script>
+ -->
+
+ <footer>
+ <hr/>
+ <p>
+ Copyright © 2010~2014 The Apache Software Foundation, Licensed
under the Apache License, Version 2.0.
+ <br/>
+ Apache Isis, Isis, Apache, the Apache feather logo, and the Apache
Isis project logo are trademarks of The Apache Software Foundation.
+ </p>
+ </footer>
+
+ </div> <!-- /container -->
+
+ </body>
+</html>
Modified: websites/staging/isis/trunk/content/documentation.html
==============================================================================
--- websites/staging/isis/trunk/content/documentation.html (original)
+++ websites/staging/isis/trunk/content/documentation.html Mon Jun 2 08:24:49
2014
@@ -957,6 +957,7 @@
<ul>
<li><a
href="components/objectstores/jdo/persistence_xml.html"><code>persistence.xml</code>
file</a></li>
<li><a
href="components/objectstores/jdo/eagerly-registering-entities.html">Eagerly
Registering Entity Types</a></li>
+<li><a
href="components/objectstores/jdo/disabling-persistence-by-reachability.html">Disabling
persistence-by-reachability</a></li>
<li><a href="components/objectstores/jdo/using-jndi-datasource.html">Using a
JNDI Datasource</a></li>
<li><a href="components/objectstores/jdo/enabling-logging.html">Enabling
Logging</a></li>
<li><a
href="components/objectstores/jdo/deploying-on-the-google-app-engine.html">Deploying
on the Google App Engine</a></li>