portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r380302 - in /portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly: alternate/db-page-manager.xml alternate/interceptors.xml boot/datasource.xml
Date Fri, 24 Feb 2006 01:54:54 GMT
Author: taylor
Date: Thu Feb 23 17:54:54 2006
New Revision: 380302

URL: http://svn.apache.org/viewcvs?rev=380302&view=rev
Log:
http://issues.apache.org/jira/browse/JS2-495
Using Spring method interceptor to clear OJB cache for Page Manager
After an object is added, 
OJB seems to be holding on to objects in the cache after rollback
Sometimes I really wonder if iBatis or even JDBC would suite us better than this endless stream
of bugs

The really fucked up thing is that this works fine in my unit test
But in production, a commit sneaks in before the rollback
No idea where that one is coming from

Added:
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/interceptors.xml
Modified:
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/boot/datasource.xml

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml?rev=380302&r1=380301&r2=380302&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/db-page-manager.xml Thu
Feb 23 17:54:54 2006
@@ -36,7 +36,7 @@
   </bean>
 
   <!-- Transaction Proxying -->
-  <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="baseTransactionProxy">
+  <bean id="org.apache.jetspeed.page.PageManager" name="pageManager" parent="PageManagerTransactionProxy">
       <property name="proxyInterfaces">
           <value>org.apache.jetspeed.page.PageManager</value>
       </property>

Added: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/interceptors.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/interceptors.xml?rev=380302&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/interceptors.xml (added)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/alternate/interceptors.xml Thu Feb
23 17:54:54 2006
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+<!--
+    Database PSML Manager Interception for handling Cache Rollback
+    We also have examples here of replay interception for failover to 
+    a second database on update failures
+   -->    
+<beans>
+
+    <bean id="pageManagerInterceptor" class="org.apache.jetspeed.util.interceptors.PageManagerInterceptor">
+    </bean>
+
+
+    <bean id="PageManagerTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
+                        abstract="true">
+        <property name="transactionManager"><ref bean="transactionManager"/></property>
+        <property name="transactionAttributes">
+            <props>
+                <prop key="*">PROPAGATION_REQUIRED</prop>
+            </props>
+        </property>
+        <property name="preInterceptors"> 
+            <list>
+                <ref local="pageManagerInterceptor" />
+            </list>
+        </property>
+    </bean>
+
+    <!--    
+        Replay support:
+        
+    <bean id="replayTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
+                        abstract="true">
+        <property name="transactionManager"><ref bean="transactionManager"/></property>
+        <property name="transactionAttributes">
+            <props>
+                <prop key="*">PROPAGATION_REQUIRED</prop>
+            </props>
+        </property>
+        <property name="preInterceptors"> 
+            <list>
+                <ref local="methodReplayInterceptor" />
+            </list>
+        </property>
+    </bean>
+        
+   <bean id="replayDecisionMakerBean"
+        class="org.apache.jetspeed.util.interceptors.TransactionalMethodReplayDecisionMaker">
+        <property name="sqlErrorCodes">
+            <value>9999, 400, -80</value> 
+             <value>9999</value>
+        </property>
+    </bean>
+
+    <bean id="methodReplayInterceptor" class="org.apache.jetspeed.util.interceptors.MethodReplayInterceptor">
+        <property name="retryCount">
+            <value>3</value>
+        </property>
+        <property name="retryInterval">
+            <value>500</value></property>  retry every 500 milliseconds

+        <property name="replayDecisionMaker">
+            <ref bean="replayDecisionMakerBean"/>
+        </property>
+    </bean>
+ -->
+            
+</beans>

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/boot/datasource.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/boot/datasource.xml?rev=380302&r1=380301&r2=380302&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/boot/datasource.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/boot/datasource.xml Thu Feb 23 17:54:54
2006
@@ -12,7 +12,26 @@
     </bean>
     		
     <bean id="ojbConfigurer" class="org.springframework.orm.ojb.support.LocalOjbConfigurer"/>

-    
+
+    <!-- 
+         Dynamically configures Database Platform for OJB by looking at the connection string
+         and figuring out the OJB platform using an OJB metadata utility
+         Its important to get this right otherwise you will be sending the wrong (most likely
HSQL)
+         flavor of SQL statements to the backend database.
+     -->
+     <bean id="PlatformConfigurator" 
+           class="org.apache.jetspeed.components.rdbms.ojb.DatabasePlatformConfigurator"
+           init-method="init"
+      >
+    	<constructor-arg index='0'>
+    		<ref bean="JetspeedDS"/>
+    	</constructor-arg>         
+        <!-- JNDI Name -->
+    	<constructor-arg index='1'>
+    		<value>JetspeedDS</value>
+    	</constructor-arg>                  
+     </bean>
+            
   <!--       
       Creates a JNDI-based datasource bean name "JetspeedDS". The information
       provided here is merged with the basic configuration for the 



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message