You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sk...@apache.org on 2007/10/10 09:34:05 UTC

svn commit: r583376 - /myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml

Author: skitching
Date: Wed Oct 10 00:34:04 2007
New Revision: 583376

URL: http://svn.apache.org/viewvc?rev=583376&view=rev
Log:
Expand faq about passing beans between conversations.

Modified:
    myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml

Modified: myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml?rev=583376&r1=583375&r2=583376&view=diff
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml Wed Oct 10 00:34:04 2007
@@ -87,20 +87,32 @@
 
 			<subsection name="The ViewController events are called twice">
 				<p>
-					If your VieController event methods are called twice you probably configured the
+					If your ViewController event methods are called twice you probably configured the
 					ViewControllerPhaseListener in your faces-config.xml which is not required.<br />
 					Orchestra already does this for you.
 				</p>
 			</subsection>
 
-			<subsection name="Is it possible to pass an entity from one conversation scoped bean to another?">
+			<subsection name="Is it possible to pass a persistent entity between beans in different conversations?">
 				<p><br>No!</br></p>
 				<p>
-					The reason is, that the entity is associated with a persistent context which is
-					different between the various conversation scoped beans.<br />
-					You are safe if you just pass the surrogating key around.<br />
-					This is not an Orchestra limitation, but more a technical limitation of how
-					the ORM work today.
+					Each conversation has its own persistence context, but an entity can only be managed
+					by the context it was loaded by.
+					<br/>
+					Reading an entity may trigger lazy loads. This will always be performed using the
+					persistence context that loaded the entity, ie this works regardless of who calls
+					the method on the entity. 
+					<br/>
+					However performing operations like merge, delete, etc. require the object to be
+					passed to a persistence context; if it is passed to the wrong one then unexpected
+					behaviour will occur. Things like using the object in a query being executed in
+					a persistence context that is not the one associated with that entity may also
+					fail.
+					<br/>
+					Rather than passing entity references between conversations, just pass the key of the
+					object and reload it if access is required from a different conversation.
+					<br/>
+					This is not an Orchestra limitation, but more a technical limitation of how	ORMs work today.
 				</p>
 			</subsection>
 		</section>