You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by ta...@apache.org on 2006/02/24 02:52:13 UTC

svn commit: r380297 - /portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java

Author: taylor
Date: Thu Feb 23 17:52:12 2006
New Revision: 380297

URL: http://svn.apache.org/viewcvs?rev=380297&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/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java

Added: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java?rev=380297&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java (added)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java Thu Feb 23 17:52:12 2006
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.
+ */
+package org.apache.jetspeed.util.interceptors;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.page.impl.DatabasePageManagerCache;
+
+/**
+ * Aspect that will attempt to rollback cache entries upon Page Manager failures
+ *
+ * @author <a href="mailto:david@bluesunrise.com">David Sean Taylor</a>
+ */
+public class PageManagerInterceptor implements MethodInterceptor
+{
+
+    /** Log reference */
+    private Log log = LogFactory.getLog(PageManagerInterceptor.class);
+
+    /** Serialization version identifier */
+    private static final long serialVersionUID = -1316279974504594833L;
+
+    /**
+     * Encloses <code>super.invoke()</code> in a try/catch block, where the
+     * catch block contains additional retry logic.
+     */
+    public Object invoke(MethodInvocation invocation) throws Throwable
+    {
+        try
+        {            
+            return invocation.proceed();
+        } 
+        catch (Exception exp)
+        {
+            DatabasePageManagerCache.rollbackTransactions();
+            throw exp;
+        }
+    }
+
+}



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


Re: svn commit: r380297 - /portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java

Posted by David Sean Taylor <da...@bluesunrise.com>.
David Jencks wrote:
> 
> On Feb 23, 2006, at 5:52 PM, taylor@apache.org wrote:
> 
>> Author: taylor
>> Date: Thu Feb 23 17:52:12 2006
>> New Revision: 380297
>>
>> URL: http://svn.apache.org/viewcvs?rev=380297&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
> 
> 
> 
> BEA has announced that they plan to open source KODO.
> 
> http://www.beasys.com/framework.jsp?CNT=pr01631.htm&FP=/content/ 
> news_events/press_releases/2006
> 
> I suggest we move to that when it is available.
> 
Thats it, give me hope, I could really use some about now

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


Re: svn commit: r380297 - /portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/util/interceptors/PageManagerInterceptor.java

Posted by David Jencks <da...@yahoo.com>.
On Feb 23, 2006, at 5:52 PM, taylor@apache.org wrote:

> Author: taylor
> Date: Thu Feb 23 17:52:12 2006
> New Revision: 380297
>
> URL: http://svn.apache.org/viewcvs?rev=380297&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


BEA has announced that they plan to open source KODO.

http://www.beasys.com/framework.jsp?CNT=pr01631.htm&FP=/content/ 
news_events/press_releases/2006

I suggest we move to that when it is available.

thanks
david jencks


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