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

svn commit: r541793 - in /myfaces/orchestra/trunk: core/src/site/site.xml core/src/site/xdoc/faqs.xml core15/pom.xml

Author: imario
Date: Fri May 25 14:58:08 2007
New Revision: 541793

URL: http://svn.apache.org/viewvc?view=rev&rev=541793
Log:
added faqs, corrected core15 module name

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

Modified: myfaces/orchestra/trunk/core/src/site/site.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/site.xml?view=diff&rev=541793&r1=541792&r2=541793
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/site.xml (original)
+++ myfaces/orchestra/trunk/core/src/site/site.xml Fri May 25 14:58:08 2007
@@ -41,7 +41,7 @@
 			<item name="Best Practice" href="bestPractice.html"/>
 			<item name="Dynamic Forms" href="dynaForm.html"/>
 			<item name="TODO" href="todo.html"/>
-
+			<item name="FAQs" href="faqs.html"/>
 		</menu>
 
 		${reports}

Added: myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml?view=auto&rev=541793
==============================================================================
--- myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml (added)
+++ myfaces/orchestra/trunk/core/src/site/xdoc/faqs.xml Fri May 25 14:58:08 2007
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE document PUBLIC "-//Apache Software Foundation//DTD XDOC 1.0//EN"
+	"http://www.apache.org/dtd/xdoc.dtd">
+<document>
+	<properties>
+		<title>FAQs</title>
+	</properties>
+
+	<body>
+		<section name="FAQ">
+
+			<subsection name="Database connection not passed back to the connection npool after the HTTP request">
+
+				<p>
+					Depending on your environment and used JPA-implementation you might experience the problem
+					that there are database connections not have been passed back to the connection pool.<br />
+					This can happen if you use entities with e.g. OneToMany mappings and lazy init AND accessing the
+					OneToMany collection from your JSF view the first time.<br />
+					The EntityManager has to re-establish a connection to your database, but now that this happens
+					outside of your conversation scoped bean, no one ends the transaction and so no one puts the
+					connection back to the pool.<br />
+					The problem is, that with a growing number of users and a growing number of conversations
+					(especially not ended conversations - waiting for its timeout) your pool might exhaust.<br />
+					As I said, I don't know if this is the case with all JPA-implementations. But we had at least
+					one environment where this happened. We admit, this was a very custom environment using plain
+					hibernate, though, we thought the workaround might help others too ... sometimes. 
+				</p>
+				<p>
+					To activate the workaround simply put the following code to your spring config and adjust the
+					names as required.
+					
+					<pre>
+&lt;bean id="managedDataSource" class="org.apache.myfaces.orchestra.connectionManager.ConnectionManagerDataSource"&gt;
+	&lt;property name="dataSource" ref="dataSource"/&gt;
+	&lt;property name="listeners"&gt;
+		&lt;bean class="org.apache.myfaces.examples.lib.LoggingConnectionManagerListener"/&gt;
+	&lt;/property&gt;
+&lt;/bean>
+					</pre>
+
+					The basic principle is, that we put a virtual DataSource between the JPA-implementation and
+					the read DataSource (which should be a connection pool for performance reasons).<br />
+
+					You have to configure
+					<ul>
+						<li>
+							the property <code>dataSource</code> to point to the original datasource and
+						</li>
+						<li>
+							the JPA configuration to use our <code>managedDataSource</code> (adjust the name if required)
+						</li>
+					</ul>
+
+					<br />
+
+					The property <code>listeners</code> is fully optional. It allows you to configure a Listener
+					which will be called on each borrow or release of a connection to do some database stuff, e.g.
+					login/logout from a legacy database system, or to set the database client info, etc. <br/>
+					Provide a class implementing the <code>org.apache.myfaces.orchestra.connectionManager.ConnectionManagerListener</code>
+					interface, or even better inherit from <code>org.apache.myfaces.orchestra.connectionManager.AbstractConnectionManagerListener</code>.
+				</p>
+
+			</subsection>
+		</section>
+	</body>
+</document>
\ No newline at end of file

Modified: myfaces/orchestra/trunk/core15/pom.xml
URL: http://svn.apache.org/viewvc/myfaces/orchestra/trunk/core15/pom.xml?view=diff&rev=541793&r1=541792&r2=541793
==============================================================================
--- myfaces/orchestra/trunk/core15/pom.xml (original)
+++ myfaces/orchestra/trunk/core15/pom.xml Fri May 25 14:58:08 2007
@@ -6,7 +6,7 @@
 	<groupId>org.apache.myfaces.orchestra</groupId>
 	<artifactId>myfaces-orchestra-core15</artifactId>
 	<packaging>jar</packaging>
-	<name>MyFaces Orchestra Core</name>
+	<name>MyFaces Orchestra Core15</name>
 
 	<parent>
 		<groupId>org.apache.myfaces.orchestra</groupId>