tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject svn commit: r712865 - in /tapestry/tapestry5/trunk: src/site/fml/faq/general.fml tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java
Date Mon, 10 Nov 2008 23:10:25 GMT
Author: hlship
Date: Mon Nov 10 15:10:24 2008
New Revision: 712865

URL: http://svn.apache.org/viewvc?rev=712865&view=rev
Log:
TAP5-337: Rapidly refreshing a page, even the same page, can cause a deadlock related to class
loading

Modified:
    tapestry/tapestry5/trunk/src/site/fml/faq/general.fml
    tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java

Modified: tapestry/tapestry5/trunk/src/site/fml/faq/general.fml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/fml/faq/general.fml?rev=712865&r1=712864&r2=712865&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/src/site/fml/faq/general.fml (original)
+++ tapestry/tapestry5/trunk/src/site/fml/faq/general.fml Mon Nov 10 15:10:24 2008
@@ -312,5 +312,34 @@
             </answer>
         </faq>
 
+        <faq id="hibernate-startup">
+            <question>
+                How do I get Hibernate to startup up when the application starts up, rather
than lazily
+                with the first request for the application?
+            </question>
+            <answer>
+                <p>This really can bother people with very large Hibernate schemas,
as Hibernate can take
+                    considerable time to start up. It would be better if Tapestry and Hibernate
initialized
+                    early, before accepting any requests.
+                </p>
+                <p>
+                    The trick is to force the Tapestry services that wrap around Hibernate
to initialize at
+                    startup. The following can be added to your AppModule:
+                </p>
+                <pre>
+                    public void contributeRegistryStartup(OrderedConfiguration&lt;Runnable&gt;
configuration, final
+                    HibernateSessionSource sessionSource)
+                    {
+                    configuration.add("HibernateStartup", new Runnable()
+                    {
+                    public void run()
+                    {
+                    sessionSource.getConfiguration();
+                    }
+                    });
+                    }
+                </pre>
+            </answer>
+        </faq>
     </part>
 </faqs>
\ No newline at end of file

Modified: tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java?rev=712865&r1=712864&r2=712865&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java
(original)
+++ tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/ClassFactoryClassPool.java
Mon Nov 10 15:10:24 2008
@@ -172,11 +172,11 @@
 
             boolean hasDomain = domain != null;
 
-            Method method = hasDomain ? defineClass : defineClassWithProtectionDomain;
+            Method method = hasDomain ? defineClassWithProtectionDomain : defineClass;
 
             Object[] args = hasDomain
-                            ? new Object[] {ct.getName(), b, 0, b.length}
-                            : new Object[] {ct.getName(), b, 0, b.length, domain};
+                            ? new Object[] {ct.getName(), b, 0, b.length, domain}
+                            : new Object[] {ct.getName(), b, 0, b.length};
 
             return (Class) method.invoke(loader, args);
         }



Mime
View raw message