You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by aa...@apache.org on 2009/05/12 04:41:05 UTC
svn commit: r773768 [1/2] - in
/cayenne/main/trunk/docs/doc/src/main/resources: ./ doc/Documentation/
doc/Documentation/Cayenne Guide/Ant Tasks/ doc/Documentation/Cayenne
Guide/Ant Tasks/cdataport/ doc/Documentation/Cayenne Guide/Ant
Tasks/cdbgen/ doc/...
Author: aadamchik
Date: Tue May 12 02:41:03 2009
New Revision: 773768
URL: http://svn.apache.org/viewvc?rev=773768&view=rev
Log:
CAY-1221 Exclude JPA from releases
docs update
Added:
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/maven2-cdbimport/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/maven2-cdbimport/index.html (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Modeler Guide/Common Modeling Tasks/Reverse Engineer Database/reengineer-connect.png (with props)
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Modeler Guide/Common Modeling Tasks/Reverse Engineer Database/reengineer-schema.png (with props)
Removed:
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Object Caching/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/RefreshQuery/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested DataContexts/
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/JPA Guide/
Modified:
cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cgen/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataObject State Management/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Obtaining DataContext/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Running Queries/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Deployment/Using JNDI/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/Cayenne Contract/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Installation/JAR Files and Dependencies/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Lifecycle Callbacks/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/maven2-cdbgen/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/maven2-cgen/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Maven2 Plugins/maven2-modeler/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/EJBQLQuery/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Queries/SQLTemplate Query/Advanced SQLTemplate/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Modeler Guide/Common Modeling Tasks/Reverse Engineer Database/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Overview/Database Support/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Overview/Guide to 1.1 Features/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Overview/Guide to 1.2 Features/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Overview/Guide to 3.0 Features/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Overview/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Remote Object Persistence Guide/Remote Object Persistence Installation/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Remote Object Persistence Guide/Remote Object Persistence Limitations/index.html
cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/index.html
Modified: cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/RELEASE-NOTES.txt Tue May 12 02:41:03 2009
@@ -39,6 +39,7 @@
CAY-1214 Class generation should create abstract callback methods in the superclass and stub methods in the subclass
CAY-1215 Move tool-like items into new cayenne-tools module
CAY-1218 Query caching loose ends
+CAY-1221 Exclude JPA from releases
Bug Fixes Since M5:
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/cdataport/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html Tue May 12 02:41:03 2009
@@ -49,6 +49,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a><ul>
</ul>
</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a></li>
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/cdbgen/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html Tue May 12 02:41:03 2009
@@ -49,6 +49,7 @@
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a></li>
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/cdbimport/index.html?rev=773768&view=auto
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html Tue May 12 02:41:03 2009
@@ -0,0 +1,164 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+ <head>
+ <title>Apache Cayenne Documentation - cdbimport</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://cayenne.apache.org/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+ <span class="pagetitle">cdbimport</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cgen/index.html">cgen</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p><tt>cdbimport</tt> is an Ant task that that uses Cayenne to generate a DataMap based on an existing database schema. This allows you to generate your DataMap prior to building your project, which may be necessary if you are also using the <a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cgen/index.html" title="cgen">cgen</a> task.</p>
+
+<h3><a name="cdbimport-Parameters"></a>Parameters</h3>
+
+<table class='confluenceTable'><tbody>
+<tr>
+<th class='confluenceTh'> Attribute </th>
+<th class='confluenceTh'> Description </th>
+<th class='confluenceTh'> Required </th>
+</tr>
+<tr>
+<td class='confluenceTd'> map </td>
+<td class='confluenceTd'> DataMap XML file to use as a schema descriptor. </td>
+<td class='confluenceTd'> Yes </td>
+</tr>
+<tr>
+<td class='confluenceTd'> overwriteExisting </td>
+<td class='confluenceTd'> Indicates whether existing DB and object entities should be overwritten. This is an all-or-nothing setting. If you need finer granularity, please use the Cayenne Modeler. Default is <tt>true</tt>. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> schemaName </td>
+<td class='confluenceTd'> Database schema to use for importing. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> tablePattern </td>
+<td class='confluenceTd'> Pattern to match tables against for import. Default is to match all tables. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> importProcedures </td>
+<td class='confluenceTd'> Indicates whether stored procedures should be imported. Default is <tt>false</tt>. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> procedurePattern </td>
+<td class='confluenceTd'> Pattern to match stored procedures against for import. Default is to match all stored procedures. This value is only meaningful if <tt>importProcedures</tt> is <tt>true</tt>. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> meaningfulPk </td>
+<td class='confluenceTd'> Indicates whether primary keys should be mapped as attributes of the object entity. Default is <tt>false</tt>. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> namingStrategy </td>
+<td class='confluenceTd'> The naming strategy used for mapping database names to object entity names. Default is <tt>org.apache.cayenne.map.naming.SmartNamingStrategy</tt>. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> adapter </td>
+<td class='confluenceTd'> Java class name implementing org.apache.cayenne.dba.DbAdapter. While this attribute is optional (a generic JdbcAdapter is used if not set), it is highly recommended to specify correct target adapter. </td>
+<td class='confluenceTd'> No (but strongly recommended) </td>
+</tr>
+<tr>
+<td class='confluenceTd'> driver </td>
+<td class='confluenceTd'> A class of JDBC driver to use for the target database. </td>
+<td class='confluenceTd'> Yes </td>
+</tr>
+<tr>
+<td class='confluenceTd'> url </td>
+<td class='confluenceTd'> JDBC connection URL of a target database. </td>
+<td class='confluenceTd'> Yes </td>
+</tr>
+<tr>
+<td class='confluenceTd'> username </td>
+<td class='confluenceTd'> Database user name. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+<tr>
+<td class='confluenceTd'> password </td>
+<td class='confluenceTd'> Database user password. </td>
+<td class='confluenceTd'> No </td>
+</tr>
+</tbody></table>
+
+
+<h3><a name="cdbimport-Example"></a>Example</h3>
+
+<p>Load the Ant task <em>(note: if you already loaded all Cayenne tasks via an antlib taskdef <a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html" title="Ant Tasks">described before</a>, this step is not needed)</em>: </p>
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><span class="code-tag"><taskdef name=<span class="code-quote">"cdbimport"</span> classname=<span class="code-quote">"org.apache.cayenne.tools.DbImporterTask"</span>></span>
+ <span class="code-tag"><classpath refid=<span class="code-quote">"classpath"</span>/></span>
+<span class="code-tag"></taskdef></span></pre>
+</div></div>
+
+<p>Here is an example of using <tt>cdbimport</tt> to create DB schema objects on a local HSQLDB.</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-xml"><cdbimport map=<span class="code-quote">"${context.dir}/WEB-INF/DefaultMap.map.xml"</span>
+ adapter=<span class="code-quote">"org.apache.cayenne.dba.hsqldb.HSQLDBAdapter"</span>
+ driver=<span class="code-quote">"org.hsqldb.jdbcDriver"</span>
+ url=<span class="code-quote">"jdbc:hsqldb:hsql://localhost/bookmarker"</span>
+ username=<span class="code-quote">"sa"</span>/></pre>
+</div></div></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2008 Apache Software Foundation
+ </div>
+
+</body>
+</html>
Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/cdeploy/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html Tue May 12 02:41:03 2009
@@ -49,13 +49,16 @@
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a></li>
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
</ul>
</div>
-<div id="ConfluenceContent"><p><tt>cdeploy</tt> is an Ant task that configures Cayenne connection information in existing jar files that contain Cayenne project information. It is useful for the automation of deployment of Cayenne-based frameworks in different environments.</p>
+<div id="ConfluenceContent"><table cellpadding='5' width='85%' cellspacing='8px' class='warningMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Deprecation Warning</b><br />cdeploy is deprecated in 3.0 and will be removed in subsequent releases</td></tr></table>
+
+<p><tt>cdeploy</tt> is an Ant task that configures Cayenne connection information in existing jar files that contain Cayenne project information. It is useful for the automation of deployment of Cayenne-based frameworks in different environments.</p>
<h3><a name="cdeploy-Parameters"></a>Parameters</h3>
<table class='confluenceTable'><tbody>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cgen/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/cgen/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cgen/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/cgen/index.html Tue May 12 02:41:03 2009
@@ -49,6 +49,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a></li>
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Ant%20Tasks/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Ant Tasks/index.html Tue May 12 02:41:03 2009
@@ -47,6 +47,7 @@
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html">cdbgen</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html">cdeploy</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html">cdataport</a></li>
+<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html">cdbimport</a></li>
</ul>
</li>
<li><a href="../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
@@ -55,13 +56,14 @@
</div>
<div id="ConfluenceContent"><h2><a name="AntTasks-Anttasks"></a>Ant tasks</h2>
-<p>Cayenne ships with Ant tasks that provide Ant frontend to a number of useful operations in Cayenne. The following tasks are included:</p>
+<p>Cayenne ships with Ant tasks that provide Ant frontend to a number of useful operations in Cayenne. These tasks are part of the cayenne-tools JAR, which must be available on the ant classpath. The following tasks are included:</p>
<ul>
<li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cgen/index.html" title="cgen">cgen</a></b> - Java class generator</li>
<li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html" title="cdbgen">cdbgen</a></b> - Database schema generator</li>
- <li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html" title="cdeploy">cdeploy</a></b> - Deployment configurator</li>
+ <li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html" title="cdeploy">cdeploy</a></b> - Deployment configurator <em>(deprecated; will be removed after 3.0)</em></li>
<li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html" title="cdataport">cdataport</a></b> - Data porting tool.</li>
+ <li><b><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html" title="cdbimport">cdbimport</a></b> - Database schema importer.</li>
</ul>
@@ -83,6 +85,7 @@
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbgen/index.html" title="cdbgen">cdbgen</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdeploy/index.html" title="cdeploy">cdeploy</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdataport/index.html" title="cdataport">cdataport</a></li>
+ <li><a href="../../../Documentation/Cayenne Guide/Ant Tasks/cdbimport/index.html" title="cdbimport">cdbimport</a></li>
</ol>
</div>
Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Caching%20and%20Fresh%20Data/Individual%20Object%20Caching/index.html?rev=773768&view=auto
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html Tue May 12 02:41:03 2009
@@ -0,0 +1,111 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+ <head>
+ <title>Apache Cayenne Documentation - Individual Object Caching</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://cayenne.apache.org/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+ <span class="pagetitle">Individual Object Caching</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html">Individual Object Caching</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html">Query Result Caching</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h2><a name="IndividualObjectCaching-IndividualObjectCaching"></a>Individual Object Caching</h2>
+
+<p>Whenever an object is fetched from the database or created by the user and registered with Cayenne, it is automatically cached. Accessing this object later (e.g. when traversing a relationship from another object, or doing a lookup by primary key via DataObjectUtils) will not incur an overhead of extra database access. </p>
+
+<h3><a name="IndividualObjectCaching-SynchronizingObjectsonCommit"></a>Synchronizing Objects on Commit</h3>
+
+<p>Very often there's more than one ObjectContext working over the same Cayenne stack. E.g. in a web application each user session may have its own ObjectContext. If one of the contexts commits its changes, Cayenne automatically updates copies of each modified object across all contexts ("copies" mean context-specific instances of objects with the same ObjectId). So all committed object changes become immediately visible to all contexts. If there's more than one Cayenne stack running (e.g. if the application is clustered across multiple JVMs), there are ways to notify other stacks about the object changes. This can be set up in the Modeler. However full synchronization of every change often results in excessive network traffic and CPU consumption, and is usually avoided in favor of the query cache approach <a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html" title="Query Result Caching">described elsewhere</a> in this chapt
er.</p>
+
+<h3><a name="IndividualObjectCaching-MemoryManagement"></a>Memory Management</h3>
+
+<p>Cayenne ensures that the memory allocated to caching does not grow indefinitely. A cache shared between ObjectContexts has a fixed upper limit. 10000 is the default maximum number of entries, which can be changed in the Modeler. A cache attached to each ObjectContext (also referred to as "local cache" elsewhere in this chapter), which only stores the objects that were accessed via this context, has no upper limit. However it uses weak references to the cached <b>committed</b> objects, so they are automatically purged from cache when the application runs low on memory.</p>
+
+<h3><a name="IndividualObjectCaching-Refreshing"></a>Refreshing</h3>
+
+<p>Object caching happens behind the scenes, so the only case when users need to worry about object cache is when an object gets stale and needs to get refreshed. Here are the strategies for refreshing a single stale object:</p>
+
+<ul>
+ <li><em>Perform a query to refetch one or more objects.</em> Any of the Cayenne selecting queries would refresh previously cached objects:
+<div class="code"><div class="codeContent">
+<pre class="code-java">Artist a = ...;
+<span class="code-comment">// <span class="code-quote">"a"</span> gets stale, we need to refresh it
+</span>SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Artist.class, ...);
+List<Artist> artists = context.performQuery(query);
+<span class="code-comment">// <span class="code-keyword">if</span> the query result includes <span class="code-quote">"a"</span>, object <span class="code-quote">"a"</span> is now refreshed</span></pre>
+</div></div> </li>
+</ul>
+
+
+<ul>
+ <li><em>Use <a href="../../../../Documentation/Cayenne Guide/Performance Tuning/Prefetching/index.html" title="Prefetching">prefetching</a> to refresh to-many relationships and related objects</em>. Cayenne selecting query would only refresh the "root" objects (objects of type "Artist" in the example above), including their "simple" properties and to-one relationships. To refresh to-many relationships, including to-many collection contents, and each of the related objects, a user must specify a prefetch on a given relationship. E.g.:
+<div class="code"><div class="codeContent">
+<pre class="code-java"><span class="code-comment">// to refresh a list of paintings attached to the Artist, use a prefetch:
+</span>query.addPrefetch(Artist.PAINTINGS_PROPERTY);</pre>
+</div></div></li>
+</ul>
+
+
+<ul>
+ <li><em>Use <a href="../../../../Documentation/Cayenne Guide/Queries/ObjectIdQuery/index.html" title="ObjectIdQuery">ObjectIdQuery</a> to refresh a single object.</em> There is a special query that allows to refresh a single object - ObjectIdQuery. Specify "CACHE_REFRESH" caching strategy to ensure a DB fetch is performed. This requires manually creating an ObjectId:
+<div class="code"><div class="codeContent">
+<pre class="code-java">ObjectId id = <span class="code-keyword">new</span> ObjectId(<span class="code-quote">"Artist"</span>, Artist.ID_PK_COLUMN, 5);
+ObjectIdQuery query = <span class="code-keyword">new</span> ObjectIdQuery(id, <span class="code-keyword">false</span>, ObjectIdQuery.CACHE_REFRESH);
+Artist a = (Artist) DataObjectUtils.objectForQuery(query);</pre>
+</div></div></li>
+</ul>
+</div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2008 Apache Software Foundation
+ </div>
+
+</body>
+</html>
Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Caching%20and%20Fresh%20Data/Query%20Result%20Caching/index.html?rev=773768&view=auto
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html Tue May 12 02:41:03 2009
@@ -0,0 +1,170 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+ <head>
+ <title>Apache Cayenne Documentation - Query Result Caching</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://cayenne.apache.org/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+ <span class="pagetitle">Query Result Caching</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html">Individual Object Caching</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html">Query Result Caching</a><ul>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><h2><a name="QueryResultCaching-QueryResultCaching"></a>Query Result Caching</h2>
+
+<p>In addition to caching individual objects, Cayenne can cache query results. Just like with object cache, the actual caching happens behind the scenes, so users only need to declare the desired cache policy, either in the code or via the Modeler:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">SelectQuery query = <span class="code-keyword">new</span> SelectQuery(Artist.class, /* some qualifier */);
+query.setCacheStrategy(QueryCacheStrategy.LOCAL_CACHE);
+query.setCacheGroups(<span class="code-quote">"artists"</span>, <span class="code-quote">"recent_exhibits"</span>);
+List<Artist> artists = context.performQuery(query);</pre>
+</div></div>
+
+<p>This query runs against the DB for the first time. Later if this query (or another query with the same parameters) is run again, the result is quickly returned from cache, and no DB access is performed.</p>
+
+<p>Next we'll discuss what cache strategies and cache groups mean.</p>
+
+<h3><a name="QueryResultCaching-CacheStrategies"></a>Cache Strategies</h3>
+
+<p>Following Cayenne stack structure, query cache can be attached either to an ObjectContext or to a DataDomain. In the former case it is not shared between the contexts, and therefore is called "local", in the later case, the cache is shared between all contexts from a given stack, and the cache is called "shared". Access to the local cache is much faster, but the tradeoff is that it takes more memory if many contexts use local caching and also it hits database more often in a situation with multiple contexts. </p>
+
+<p>Formally cache strategies are defined in the QueryCacheStrategy enum as NO_CACHE, LOCAL_CACHE, LOCAL_CACHE_REFRESH, SHARED_CACHE, SHARED_CACHE_REFRESH. Strategies ending with "_REFRESH" would actually run the query against database, but then cache the result. These are not used very often, as it is a good idea to separate cache refresh logic from the query code (as discussed below). Therefore the most common caching strategies are LOCAL_CACHE and SHARED_CACHE.</p>
+
+<h3><a name="QueryResultCaching-CacheGroups"></a>Cache Groups</h3>
+
+<p>As shown in the example above, each query can be tagged with one or more "cache groups". Cache groups are symbolic names that a user assigns to certain queries to group them for the purpose of defining a common cache policy. These cache groups are just strings which can then be used as a way to indicate what data you'd like to refresh and when you'd like it refreshed.</p>
+
+<h3><a name="QueryResultCaching-QueryCacheManagement"></a>QueryCache Management</h3>
+
+<p>The query cache provider is installed via <tt>org.apache.cayenne.cache.QueryCacheFactory</tt>. The factory can be configured in the Modeler for the DataDomain, or set in code. Cayenne supplies a few factories out of the box that should be sufficient in most cases.</p>
+
+<h4><a name="QueryResultCaching-SimpleCacheProviderLRUMap"></a>Simple Cache Provider - LRUMap</h4>
+
+<p>The default factory is <tt>org.apache.cayenne.cache.MapQueryCacheFactory</tt> that is simply an LRU map. Cache entries never expire by themselves, but rarely used entries will be eventually swapped out when the cache is operating at the 100% capacity. This is the simplest form of query cache that requires users to implement their own "active" invalidation strategies accessing the methods of <tt>org.apache.cayenne.cache.QueryCache</tt> interface directly.</p>
+
+<h4><a name="QueryResultCaching-AdvancedCacheProviderOSCache"></a>Advanced Cache Provider - OSCache</h4>
+
+<p>A much more advanced cache provider can be installed via <tt>org.apache.cayenne.cache.OSQueryCacheFactory</tt>. The actual cache is using <span class="nobr"><a href="http://www.opensymphony.com/oscache/" title="Visit page outside Confluence" rel="nofollow">OSCache<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> by OpenSymphony, so <a href="../../../../Documentation/Cayenne Guide/Installation/JAR Files and Dependencies/index.html" title="JAR Files and Dependencies">OSCache jars</a> need to be added to the application classpath. Cache configuration should be created outside Cayenne tools (e.g. in a text editor or in Eclipse) in a file called <br/>
+<tt>"oscache.properties"</tt>. This file should be placed in the application classpath. The file format follows a regular java properties file. Here is an example that shows some of its capabilities, and demonstrates how to configure cache policies per cache group. More standard properties are discussed in the <span class="nobr"><a href="http://www.opensymphony.com/oscache/wiki/Configuration.html" title="Visit page outside Confluence" rel="nofollow">OSCache documentation<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>.</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre># OSCache standard configuration:
+
+#cache.memory=true
+#cache.blocking=false
+cache.capacity=5000
+cache.algorithm=com.opensymphony.oscache.base.algorithm.LRUCache
+
+# Cayenne specific properties:
+
+# Default refresh period in seconds
+# (used for all cache groups not explicitly overriding it here)
+cayenne.default.refresh = 60
+
+# Default expiry specified as cron expressions per
+# http://www.opensymphony.com/oscache/wiki/Cron%20Expressions.html
+# expire entries every hour on the 10's minute
+cayenne.default.cron = 10 * * * *
+
+# Same parameters can be defined per cache group, overriding the defaults
+# cache group name is specified inside the property key. E.g. "artists" below
+# is a cache group name
+cayenne.group.artists.refresh = 120
+cayenne.group.artists.cron = 10 1 * * *
+</pre>
+</div></div>
+
+<p>As shown in this example, you can specify either a fixed expiration time since the entry was created or a cron-like cache expiration expression. Both can be specified either for the entire cache and/or one or more cache groups. As you see, cache groups become really useful when OSCache is used, and you don't have to do explicit cache management in the code. It is all 100% declarative. OSCache itself is very efficient when expiring groups that may potentially contain thousands of entries. Instead of scanning the entire cache for all entries that need to be expired, it simply tags the entire group as expired, so performance of this solution is really great.</p>
+
+<h3><a name="QueryResultCaching-InstantCacheInvalidation"></a>Instant Cache Invalidation</h3>
+
+<p>The above OSCache configuration is very flexible, however even this setup it does not address one important scenario - invalidation of a cache group on demand. This is often needed when a certain object is updated in the application, potentially rendering invalid a whole bunch of previously cached query results. How do we invalidate those cached object lists? </p>
+
+<p>The first step is to find a place where an explicit cache update should be triggered. Usually this is done via <a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html" title="Lifecycle Callbacks">post commit callbacks</a>. A callback or a listener method would gain access to the QueryCache instance and call "removeGroup" for all groups that need to be invalidated. Here is where careful selection of query cache groups pays off. E.g. we may have tagged all queries fetching deceased artists with "classics" and all modern artists as "modern". The Artist entity can map a callback method similar to this:</p>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">void onCommit() {
+ QueryCache cache = ((BaseContext) getObjectContext()).getQueryCache();
+ <span class="code-keyword">if</span>(isModern()) {
+ cache.removeGroup(<span class="code-quote">"modern"</span>);
+ }
+ <span class="code-keyword">else</span> {
+ cache.removeGroup(<span class="code-quote">"classic"</span>);
+ }
+}
+}</pre>
+</div></div>
+
+<p>This will ensure that subsequent "performQuery" calls will not use stale data, and the cache gets lazily refreshed.</p>
+
+<p>The above approach is applicable to both LRU Map and OSCache. As expected, OSCache gives us extra capabilities in this area as well. As we've mentioned already, sending object change notifications between (possibly remote) Cayenne stacks is inefficient most of the time. Not so with OSCache. It can send remote invalidation notifications that are simply cache group names, so they create very little network traffic. Also on the receiving end invalidation is processed lazily, so no extra CPU cycles are immediately needed for the application to process an event. OSCache comes with support for JavaGroups and JMS notifications. To enable it add one of the following entries to <tt>"oscache.properties"</tt> per <span class="nobr"><a href="http://www.opensymphony.com/oscache/wiki/Clustering.html" title="Visit page outside Confluence" rel="nofollow">OSCache clustering guide<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="
" border="0"/></sup></a></span> :</p>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JMSBroadcastingListener
+# other JMS paramaters go here...</pre>
+</div></div>
+
+<div class="preformatted"><div class="preformattedContent">
+<pre>cache.event.listeners=com.opensymphony.oscache.plugins.clustersupport.JavaGroupsBroadcastingListener
+# other JavaGroups paramaters go here...</pre>
+</div></div>
+
+<h3><a name="QueryResultCaching-QueryCacheConclusions"></a>Query Cache Conclusions</h3>
+
+<p>The consequence of consistently using caching strategies and coming up with reasonable set of ache groups is that many applications no longer has to cache fetched lists explicitly. Re-running a query with a one of the caching strategies (especially with "LOCAL_CACHE") becomes an extremely fast operation. Also the code becomes cleaner, as the state is stored in Cayenne, not in the application code. One possible exception from this rule is when the application needs to access the same list between requests, regardless of whether it is stale or not. </p>
+
+</div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2008 Apache Software Foundation
+ </div>
+
+</body>
+</html>
Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Caching%20and%20Fresh%20Data/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Caching and Fresh Data/index.html Tue May 12 02:41:03 2009
@@ -41,8 +41,8 @@
<li><a href="../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a><ul>
-<li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/RefreshQuery/index.html">RefreshQuery</a></li>
-<li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Object Caching/index.html">Object Caching</a></li>
+<li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html">Individual Object Caching</a></li>
+<li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html">Query Result Caching</a></li>
</ul>
</li>
<li><a href="../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
@@ -51,47 +51,31 @@
<li><a href="../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
</ul>
</div>
-<div id="ConfluenceContent"><h2><a name="CachingandFreshData-WhatIsCachedinCayenne"></a>What Is Cached in Cayenne</h2>
+<div id="ConfluenceContent"><h2><a name="CachingandFreshData-CachingandFreshData"></a>Caching and Fresh Data</h2>
-<p>Cayenne uses multiple levels of cache to significantly improve performance by reducing the number of trips to the database. Cayenne caches individual objects, reducing the need to fetch them from the database. It also is able to cache query results, that is, the information about which objects were retrieved by a particular query.</p>
+<p>Caching is used by Cayenne to reduce database access and improve performance of your application. Sometimes caching automatically happens behind the scenes, and in other places the user must declare an intent to cache data. Configuring caching parameters beyond the provided reasonable defaults is an art of balancing performance with the need to see the fresh data.</p>
-<h2><a name="CachingandFreshData-Objectcache"></a>Object cache</h2>
+<p>The are two types of cache in Cayenne:</p>
-<p>Individual objects are <a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Object Caching/index.html" title="Object Caching">cached by Cayenne</a> by default as they are fetched from the database or created by the user. Such caching is both a performance optimization mechanism and a way to ensure internal object <a href="http://cwiki.apache.org/confluence/confluence/display/CAYDOC/Cayenne%20Contract#CayenneContract-Uniquing" title="Uniquing on Cayenne Contract">uniquing</a>. Users normally do not need to do anything special for this to work.</p>
+<h3><a name="CachingandFreshData-QueryCache"></a>Query Cache</h3>
-<p>TODO</p>
-
-<h2><a name="CachingandFreshData-Querycache"></a>Query cache</h2>
-
-<p>The query cache stores the result of a Query (SelectQuery, SqlTemplate or ProcedureQuery). The cached results are lists of objects. The cached list is matched to a query using a unique key internally generated by Cayenne for each query. Please mind that the query cache does not automatically refresh when committing changes, so if you query for all Artists starting with 'B', create a new artist 'Bob' and commit them, perform the same query again without refreshing the cache, then 'Bob' will not be found since the earlier cached query will be returned.</p>
-
-<h3><a name="CachingandFreshData-Refreshingquerycache"></a>Refreshing query cache</h3>
-
-<p>TODO</p>
-
-
-<h2><a name="CachingandFreshData-PluggableCache"></a>Pluggable Cache</h2>
-
-<p>Third party caching providers can be used with Cayenne to provide more flexible caching options. Out of the box Cayenne provides two implementations of the pluggable cache factory:</p>
-
-<ul>
- <li><tt>'org.apache.cayenne.cache.MapQueryCacheFactory'</tt> is a default factory that uses an LRU map to store query results. LRU map ensures that cached results would not take up all available memory, but otherwise it has no cache expiration mechanism.</li>
-</ul>
-
-
-<ul>
- <li><tt>'org.apache.cayenne.cache.OSQueryCacheFactory'</tt> is a factory that installs OpenSymphony <span class="nobr"><a href="http://www.opensymphony.com/oscache/wiki/Configuration.html" title="Visit page outside Confluence" rel="nofollow">OSCache<sup><img class="rendericon" src="../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> as a cache provider for Cayenne queries. It allows to configure cache expiration policies and cross-VM synchronization via an <tt>"oscache.properties"</tt> that should be placed in the CLASSPATH.</li>
-</ul>
+<p>This cache retains the results of a query in memory. When this cache is utilised by the second and successive queries, no further SELECT is performed on the database to determine which records match your query parameters. </p>
+<h3><a name="CachingandFreshData-ObjectCache"></a>Object Cache</h3>
+<p>This cache stores the actual objects and not only eliminates the time required to fetch data from the database, but also the time required to instantiate that data into Java objects.</p>
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>As of Cayenne 3.0, two types of caches (individual object and query results) are separate from each other. Query cache can be extended and managed, while individual object cache has fewer configuration options - just max size and synchronization strategy. There are plans to reconcile both caches in the following releases.</td></tr></table>
<h3><a name="CachingandFreshData-Sections"></a>Sections</h3>
<ol>
- <li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/RefreshQuery/index.html" title="RefreshQuery">RefreshQuery</a></li>
- <li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Object Caching/index.html" title="Object Caching">Object Caching</a></li>
+ <li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Individual Object Caching/index.html" title="Individual Object Caching">Individual object caching</a></li>
+ <li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html" title="Query Result Caching">Query result caching</a></li>
</ol>
+
+
+
</div>
</div>
<div class="clearer">.</div>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/DataContextDelegate/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
</ul>
</li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/DataContextFactory/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a><ul>
</ul>
</li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataObject State Management/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/DataObject%20State%20Management/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataObject State Management/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/DataObject State Management/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/Moving%20Objects%20Between%20Contexts/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
</li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Added: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/Nested%20Contexts/index.html?rev=773768&view=auto
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html (added)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html Tue May 12 02:41:03 2009
@@ -0,0 +1,125 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<html>
+ <head>
+ <title>Apache Cayenne Documentation - Nested Contexts</title>
+ <style type="text/css">@import "../../../../style.css";</style>
+ </head>
+<body>
+ <div class="header">
+ <div style="float: left;"><a href="http://cayenne.apache.org/"><img src="../../../../images/logo.gif" align="absmiddle" border="0"></a></div>
+ <span class="logoSpaceLink"><a href="../../../../index.html">Cayenne User Documentation</a></span><br />
+ <span class="pagetitle">Nested Contexts</span>
+ </div>
+<div id="cayenne_toc">
+<ul>
+<li><a href="../../../../Documentation/Cayenne Guide/Introduction/index.html">Introduction</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Installation/index.html">Installation</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Quick Start/index.html">Quick Start</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Design/index.html">Design</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/index.html">DataContext</a><ul>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Obtaining DataContext/index.html">Obtaining DataContext</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Running Queries/index.html">Running Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataObject State Management/index.html">DataObject State Management</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a><ul>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
+</ul>
+</li>
+<li><a href="../../../../Documentation/Cayenne Guide/Queries/index.html">Queries</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataObjects/index.html">DataObjects</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Stored Procedures/index.html">Stored Procedures</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Expressions/index.html">Expressions</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Lifecycle Callbacks/index.html">Lifecycle Callbacks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Performance Tuning/index.html">Performance Tuning</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/index.html">Caching and Fresh Data</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Deployment/index.html">Deployment</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Ant Tasks/index.html">Ant Tasks</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Maven2 Plugins/index.html">Maven2 Plugins</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
+</ul>
+</div>
+<div id="ConfluenceContent"><p>One of the goals of the ObjectContext is to provide an isolated area where local object changes can be performed without affecting other similar areas or the underlying storage. At some point in time users would either commit changes to the underlying storage or undo them (roll them back). </p>
+
+<p>If a DataContext is directly attached to the DataDomain, a call to <tt>DataContext.commitChanges()</tt> results in changes written to the database. On the other hand if DataContext's direct parent in the access stack is not a DataDomain, but another DataContext, changes can be saved to the parent without saving them to the database. Such child context is often called "nested".</p>
+
+<p>Same thing is true when ObjectContext is used via ROP. Committing changes to a nested ROP ObjectContext (CayenneContext) locally will not result in sending data to a server.</p>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">ROP</b><br />
+<p>Nested contexts are available in Cayenne ROP (three tier) only from version 3.0M6.</p></td></tr></table>
+
+<p>Nested contexts are useful in many situations, such as nested UI dialogs, complicated workflows, etc.</p>
+
+<h3><a name="NestedContexts-CreatingNestedContexts"></a>Creating Nested Contexts</h3>
+
+<table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="../../../../images/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b class="strong">Deprecation</b><br />
+<p>Since 3.0M6 a new method, <tt>ObjectContext.createChildContext()</tt> was introduced, so <tt>DataContext.createChildDataContext()</tt> is now deprecated. Please update your code properly.</p></td></tr></table>
+
+<div class="code"><div class="codeContent">
+<pre class="code-java">ObjectContext parent = ...
+ObjectContext child = context.createChildContext();</pre>
+</div></div>
+
+<p><tt>child</tt> object will be instance of the same class, as <tt>parent</tt> is - DataContext or CayenneContext.</p>
+
+<p>When creating a nested DataContext, note that if there was a DataContextFactory configured for the DataDomain at the top of the context hierarchy, such factory will be used internally by <tt>createChildDataContext</tt> method. Also child DataContext inherits parent's <tt>"ValidatingObjectsOnCommit"</tt> property.</p>
+
+<h3><a name="NestedContexts-UsingNestedContexts"></a>Using Nested Contexts</h3>
+
+<p>A nested context does everything a parent context can do, i.e. perform queries, register new objects, delete objects, etc. A specific behavior is the ability to choose between a cascading or one-level commit or rollback.</p>
+
+<p>Regular <tt>"commitChanges"</tt> call does a cascading commit through the stack of parents all the way to the database:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.commitChanges();</pre>
+</div></div>
+
+<p>However it is possible to commit to parent, without triggering a DB commit:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.commitChangesToParent();</pre>
+</div></div>
+
+<p>Same thing with rollback, <tt>"rollbackChanges"</tt> does a cascading rollback:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.rollbackChanges();</pre>
+</div></div>
+
+<p>While <tt>"rollbackChangesLocally"</tt> only affects the nested context, and not even sent to the parent:</p>
+<div class="code"><div class="codeContent">
+<pre class="code-java">child.rollbackChangesLocally();</pre>
+</div></div>
+
+<p>From the child context, you may want to get a reference to the parent context. Use child.getChannel() to get the parent context, and if called from the top level context context.getChannel() will return the DataDomain.</p>
+
+<h3><a name="NestedContexts-NestedContextsPerformance"></a>Nested Contexts Performance</h3>
+
+<p>All cascading operations (such as a select query or a cascading update) initiated by a nested context will have to travel through the stack of parent contexts, incurring certain delay at each stack level. The delay is due to the fact that each context has to update its own objects during most operations. So nesting should only be used when application specifics require to do so. Also nesting of more than a few levels should be avoided.</p></div>
+</div>
+ <div class="clearer">.</div>
+ <div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
+
+ <div class="smalltext copyright">
+ Copyright ©2001-2008 Apache Software Foundation
+ </div>
+
+</body>
+</html>
Propchange: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/ObjectContext%20Memory%20Management/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html Tue May 12 02:41:03 2009
@@ -40,7 +40,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a><ul>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Obtaining DataContext/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/Obtaining%20DataContext/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Obtaining DataContext/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Obtaining DataContext/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Running Queries/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/Running%20Queries/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Running Queries/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/Running Queries/index.html Tue May 12 02:41:03 2009
@@ -42,7 +42,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/DataContext/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/DataContext/index.html Tue May 12 02:41:03 2009
@@ -40,7 +40,7 @@
<li><a href="../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html">Moving Objects Between Contexts</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html">DataContextDelegate</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html">DataContextFactory</a></li>
-<li><a href="../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html">Nested DataContexts</a></li>
+<li><a href="../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html">Nested Contexts</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html">ObjectContext Memory Management</a></li>
</ul>
</li>
@@ -71,7 +71,7 @@
<li><a href="../../../Documentation/Cayenne Guide/DataContext/Moving Objects Between Contexts/index.html" title="Moving Objects Between Contexts">Moving Objects Between Contexts</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/DataContextDelegate/index.html" title="DataContextDelegate">DataContextDelegate</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/DataContextFactory/index.html" title="DataContextFactory">DataContextFactory</a></li>
- <li><a href="../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html" title="Nested DataContexts">Nested DataContexts</a></li>
+ <li><a href="../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html" title="Nested Contexts">Nested Contexts</a></li>
<li><a href="../../../Documentation/Cayenne Guide/DataContext/ObjectContext Memory Management/index.html" title="ObjectContext Memory Management">ObjectContext Memory Management</a></li>
</ol>
</div>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Deployment/Using JNDI/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Deployment/Using%20JNDI/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Deployment/Using JNDI/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Deployment/Using JNDI/index.html Tue May 12 02:41:03 2009
@@ -58,8 +58,7 @@
<li><a href="../../../../Documentation/Cayenne Guide/Customization/index.html">Customization</a></li>
</ul>
</div>
-<div id="ConfluenceContent">
-<p>Cayenne can be setup to obtain a DataSource via JNDI, instead of using its own connection pool. To do that Cayenne DataNodes must be configured to use <tt>JNDIDataSourceFactory</tt>. This can be done in the modeler as shown on the pictures below.</p>
+<div id="ConfluenceContent"><p>Cayenne can be setup to obtain a DataSource via JNDI, instead of using its own connection pool. To do that Cayenne DataNodes must be configured to use <tt>JNDIDataSourceFactory</tt>. This can be done in the modeler as shown on the pictures below.</p>
<p>1. Select JNDIDataSourceFactory:<br/>
<img src="jndi-step1.jpg" align="absmiddle" border="0" /></p>
@@ -103,7 +102,7 @@
</resource-ref></pre>
</div></div>
-<p>Below are sample DataSource configurations for Tomcat 5.5 and 5.0. The XML should be pasted into <tt>$CATALINA_HOME/conf/server.xml</tt> file between the <tt><Host>...</Host></tt> tags. Of course the application name and database parameters should be replaced with the correct values for the target environment. </p>
+<p>Below are sample DataSource configurations for Tomcat 5.5 and newer. The XML should be pasted into <tt>$CATALINA_HOME/conf/server.xml</tt> file between the <tt><Host>...</Host></tt> tags. Of course the application name and database parameters should be replaced with the correct values for the target environment. </p>
@@ -117,40 +116,7 @@
username="userName" password="secret" maxActive="5" maxIdle="2"/>
</Context></pre>
</div></div>
-
-<h4><a name="UsingJNDI-Tomcat5.0Configuration"></a>Tomcat 5.0 Configuration</h4>
-
-<div class="preformatted"><div class="preformattedContent">
-<pre><Context path="/myapp" docBase="myapp">
- <Resource name="jdbc/myds" auth="Container" type="javax.sql.DataSource"/>
- <ResourceParams name="jdbc/myds">
- <parameter>
- <name>driverClassName</name>
- <value>oracle.jdbc.driver.OracleDriver</value>
- </parameter>
- <parameter>
- <name>url</name>
- <value>jdbc:oracle:thin:@127.0.0.1:1521:dbname</value>
- </parameter>
- <parameter>
- <name>username</name>
- <value>***</value>
- </parameter>
- <parameter>
- <name>password</name>
- <value>****</value>
- </parameter>
- <parameter>
- <name>maxActive</name>
- <value>20</value>
- </parameter>
- <parameter>
- <name>maxIdle</name>
- <value>10</value>
- </parameter>
- </ResourceParams>
-</Context></pre>
-</div></div></div>
+</div>
</div>
<div class="clearer">.</div>
<div style="height: 12px; background-image: url('../../../../images/border_bottom.gif'); background-repeat: repeat-x;"></div>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/Cayenne Contract/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Design/Cayenne%20Contract/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/Cayenne Contract/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/Cayenne Contract/index.html Tue May 12 02:41:03 2009
@@ -116,7 +116,7 @@
<h3><a name="CayenneContract-MultipleLevelsofCommitandRollbackNesting"></a>Multiple Levels of Commit and Rollback Nesting</h3>
-<p>Commit and rollback functionality can have <a href="../../../../Documentation/Cayenne Guide/DataContext/Nested DataContexts/index.html" title="Nested DataContexts">multiple levels of nesting</a> (i.e. a context can rollback its changes without affecting the parent context; or commit its changes to parent without committing them all the way to the database). </p>
+<p>Commit and rollback functionality can have <a href="../../../../Documentation/Cayenne Guide/DataContext/Nested Contexts/index.html" title="Nested Contexts">multiple levels of nesting</a> (i.e. a context can rollback its changes without affecting the parent context; or commit its changes to parent without committing them all the way to the database). </p>
<h3><a name="CayenneContract-Relationships"></a>Relationships</h3>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Design/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Design/index.html Tue May 12 02:41:03 2009
@@ -65,7 +65,6 @@
<li><a href="../../../Documentation/Cayenne Guide/Design/Runtime Components/index.html" title="Runtime Components">Runtime Components</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Design/Understanding Transactions/index.html" title="Understanding Transactions">Transactions</a></li>
<li><a href="../../../Documentation/Cayenne Guide/Design/Primary Key Generation/index.html" title="Primary Key Generation">Primary Key generation strategies</a></li>
- <li><a href="../../../Documentation/Cayenne Guide/Caching and Fresh Data/Object Caching/index.html" title="Object Caching">Object caching mechanism</a></li>
</ol>
</div>
</div>
Modified: cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Installation/JAR Files and Dependencies/index.html
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne%20Guide/Installation/JAR%20Files%20and%20Dependencies/index.html?rev=773768&r1=773767&r2=773768&view=diff
==============================================================================
--- cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Installation/JAR Files and Dependencies/index.html (original)
+++ cayenne/main/trunk/docs/doc/src/main/resources/doc/Documentation/Cayenne Guide/Installation/JAR Files and Dependencies/index.html Tue May 12 02:41:03 2009
@@ -94,6 +94,7 @@
<li><span class="nobr"><a href="http://www.jgroups.org/" title="Visit page outside Confluence" rel="nofollow">JGroups<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>, version 2.2.7 or newer. Needed if you plan to use remote notifications via JGroups transport.</li>
<li><span class="nobr"><a href="http://java.sun.com/products/jms/" title="Visit page outside Confluence" rel="nofollow">Java Messaging Service (JMS)<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. Needed if you plan to use remote notifications via JMS transport.</li>
<li><span class="nobr"><a href="http://vpp.sourceforge.net/" title="Visit page outside Confluence" rel="nofollow">Foundry Logic VPP Library<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>, version 2.2.1. Needed for <a href="../../../../Documentation/Cayenne Guide/Ant Tasks/cgen/index.html" title="cgen">advanced class generation options</a> with Ant.</li>
+ <li><span class="nobr"><a href="http://www.opensymphony.com/oscache/" title="Visit page outside Confluence" rel="nofollow">OSCache<sup><img class="rendericon" src="../../../../images/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> version 2.3.2 or newer. Needed if you plan to use OSCache as your <a href="../../../../Documentation/Cayenne Guide/Caching and Fresh Data/Query Result Caching/index.html" title="Query Result Caching">query results cache provider</a>.</li>
</ul>
</div>
</div>