Author: danhaywood
Date: Mon Jun 2 08:26:45 2014
New Revision: 1599120
URL: http://svn.apache.org/r1599120
Log:
persistence by reachability
Modified:
isis/site/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.md
Modified:
isis/site/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.md
URL:
http://svn.apache.org/viewvc/isis/site/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.md?rev=1599120&r1=1599119&r2=1599120&view=diff
==============================================================================
---
isis/site/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.md
(original)
+++
isis/site/trunk/content/components/objectstores/jdo/disabling-persistence-by-reachability.md
Mon Jun 2 08:26:45 2014
@@ -1,15 +1,13 @@
Title: Disabling Persistence by Reachability
-JDO/DataNucleus supports the concept of
[persistence-by-reachability](http://www.datanucleus.org/products/datanucleus/jdo/orm/cascading.html).
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.
+By default, JDO/DataNucleus supports the concept of
[persistence-by-reachability](http://www.datanucleus.org/products/datanucleus/jdo/orm/cascading.html).
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. Put another way: there is no need to call Isis'
`DomainObjectContainer#persist(.)` or
`DomainObjectContainer#persistIfNotAlready(.)` methods.
-Put another way: there is no need to call Isis'
`DomainObjectContainer#persist(.)` or
`DomainObjectContainer#persistIfNotAlready(.)` methods.
-
-However, convenient though this feature is, you may find that it causes
performance issues.
+However, convenient though this feature is, *you may find that it causes
performance issues*.
One scenario in particular where this performance issues can arise is if your
entities implement the `java.lang.Comparable` interface, and you have used
Isis' [ObjectContracts](../../../reference/Utility.html) utility. The issue
here is that `ObjectContracts` implementation can cause DataNucleus to
recursively rehydrate a larger number of associated entities. (More detail
below).
-To disable persistence-by-reachability, add the following to
`persistor_datanucleus.properties`:
+We therefore *recommend that you disable persistence-by-reachability*, add the
following to `persistor_datanucleus.properties`:
#
# Require explicit persistence (since entities are Comparable and using
ObjectContracts#compareTo).
@@ -18,6 +16,8 @@ To disable persistence-by-reachability,
This change has been made to the
[simple](../../../intro/getting-started/simple-archetype.html) and
[quickstart](../../../intro/getting-started/quickstart-archetype.html)
archetypes (1.5.0-snapshot).
+If you do disable this feature, then you will (of course) need to ensure that
you explicitly persist all entities using the
`DomainObjectContainer#persist(.)` or
`DomainObjectContainer#persistIfNotAlready(.)` methods.
+
#### Explanation of the issue in more detail