Author: cmailleux
Date: Thu Jul 12 19:16:37 2007
New Revision: 17988

URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D17988&repname=
=3Djahia
Log:
Port of issue [16995] Correct issue ESI-300 avoid NPE if template not avail=
able
Port of [17920] Avoid NPE when cache is flushed
Port of [17939] Use OPTIMISTIC LOCK for JBoss Cache
Port of [17944] Back to oswego

Update of SQL schema to reflect changes in jahia_link column size

Modified:
    trunk/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java
    trunk/core/src/java/org/jahia/services/esi/EsiService.java
    trunk/core/src/java/org/jahia/taglibs/esi/JesiBodyTag.java
    trunk/core/src/webapp/WEB-INF/var/db/sql/schema/hypersonic/jahia-schema=
.sql
    trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mssql/jahia-schema.sql
    trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mysql/jahia-schema.sql
    trunk/core/src/webapp/WEB-INF/var/db/sql/schema/oracle/jahia-schema.sql
    trunk/core/src/webapp/WEB-INF/var/db/sql/schema/postgresql/jahia-schema=
.sql

Modified: trunk/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.ja=
va
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/aop/EsiJspContentDetectionAspect.java&rev=3D17988&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java (or=
iginal)
+++ trunk/core/src/java/org/jahia/aop/EsiJspContentDetectionAspect.java Thu=
 Jul 12 19:16:37 2007
@@ -350,7 +350,7 @@
                     + joinPoint.getCalleeClass().getName() + "::"
                     + signature.getName() + "\n" + joinPoint.toString()
                     + "Exception : "
-                    + ptrWriter.toString()
+                    + strWriter.getBuffer().toString()
                     );
             System.err.println("------- aspObj: "+ aspObj);
         }

Modified: trunk/core/src/java/org/jahia/services/esi/EsiService.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/services/esi/EsiService.java&rev=3D17988&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/services/esi/EsiService.java (original)
+++ trunk/core/src/java/org/jahia/services/esi/EsiService.java Thu Jul 12 1=
9:16:37 2007
@@ -17,6 +17,7 @@
  */package org.jahia.services.esi;
 =

 import org.jahia.services.*;
+import org.jahia.services.cache.jboss.TomcatTransactionManagerLookup;
 import org.jahia.services.esi.tagstack.Fragment;
 import org.jahia.services.esi.tagstack.Template;
 import org.jahia.services.esi.tagstack.JesiObject;
@@ -25,6 +26,7 @@
 import org.jahia.services.usermanager.JahiaUser;
 =

 import java.util.*;
+
 import org.jahia.bin.Jahia;
 import org.jahia.exceptions.JahiaInitializationException;
 import org.jahia.data.containers.JahiaContainer;
@@ -137,15 +139,15 @@
 =

         try {
             cache =3D new TreeCache();
-            cache.setClusterName(clusterName);
-            cache.setClusterProperties(clusterProperties);
+            cache.setNodeLockingScheme("OPTIMISTIC");
+            cache.setTransactionManagerLookup(new DummyTransactionManagerL=
ookup());
             if (clusterActivated && Jahia.getSettings().isEsiCacheActivate=
d()) {
                 cache.setCacheMode(TreeCache.REPL_SYNC);
+                cache.setClusterName(clusterName);
+                cache.setClusterProperties(clusterProperties);
             } else {
                 cache.setCacheMode(TreeCache.LOCAL);
             }
-            // the most important setting here is the isolation level.
-            cache.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED ); //a=
vailable: NONE, READ_UNCOMMITTED, READ_COMMITTED, REPEATABLE_READ or SERIAL=
IZABLE
 =

             //PropertyConfigurator config =3D new PropertyConfigurator();
             //config.configure(cache, "treecache-esi.xml");
@@ -1796,33 +1798,39 @@
             newFrgNode.setChildren(tempFrgNode.getChildren()); //TODO: may=
be need a clone here
             //cache.put(newFrgNodeKey, tempFrgNode.getChildren());
 =

-            Fragment newFrg =3D (Fragment) cache.get(newFrgNodeKey, JesiOb=
ject.FRAGMENT_OBJ_MAPKEY);
-
+            Fragment newFrg =3D (Fragment) newFrgNode.get(JesiObject.FRAGM=
ENT_OBJ_MAPKEY);
+            if(newFrg =3D=3D null) {
+                cache.remove(frgTempNodeKey);
+                cache.remove(newFrgNodeKey);
+            }
             Template tpl =3D getTemplate(pageID);
-            String templateNodeKey =3D tpl.getNodeKey(); //TODO : not very=
 efficient
-            //remove the reference to the old absolute fragment in parent =
template
-            Object deletedRef =3D cache.remove(templateNodeKey+JesiObject.=
ABSOLUTE_FRAGS_NODEKEY,
-                    frgTempNodeKey);
-            //sanity check
-            if(deletedRef=3D=3Dnull)
-                logger.warn("[esi]:  could find MapKey entry [" +frgTempNo=
deKey+ "] in Template Node ["+templateNodeKey+JesiObject.ABSOLUTE_FRAGS_NOD=
EKEY+"] which was due for removal.");
-            //add new reference to the final absolute fragment in the pare=
nt template
-            cache.put(templateNodeKey+JesiObject.ABSOLUTE_FRAGS_NODEKEY,
-                    newFrgNodeKey, //using it as a mapkey
-                    "added by Template "+ templateNodeKey //TODO: change t=
o a dummy value
-            );
+            if (tpl !=3D null) {
+                String templateNodeKey =3D tpl.getNodeKey(); //TODO : not =
very efficient
+                //remove the reference to the old absolute fragment in par=
ent template
+                //sanity check
+                if (cache.remove(templateNodeKey + JesiObject.ABSOLUTE_FRA=
GS_NODEKEY,
+                                 frgTempNodeKey) =3D=3D null)
+                    logger.warn( "[esi]:  could find MapKey entry [" + frg=
TempNodeKey + "] in Template Node [" +
+                                 templateNodeKey + JesiObject.ABSOLUTE_FRA=
GS_NODEKEY + "] which was due for removal.");
+                //add new reference to the final absolute fragment in the =
parent template
+                cache.put(templateNodeKey + JesiObject.ABSOLUTE_FRAGS_NODE=
KEY,
+                          newFrgNodeKey, //using it as a mapkey
+                          "added by Template " + templateNodeKey //TODO: c=
hange to a dummy value
+                );
+            }
 =

             //first, make sure we rename the references to current Fragmen=
t in the contentId Trackback node tree to the new one
             tempFrg.renameTrackbackNodeInContentIds( newFrgNodeKey);
 =

             //reset some of the values in the copied node
-            newFrg.setNodeKey(newFrgNodeKey);
+            if (newFrg !=3D null) {
+                newFrg.setNodeKey(newFrgNodeKey);
             String absoluteHeader =3D newFrg.getAbsoluteKeyHeader();
             absoluteHeader =3D absoluteHeader.replaceFirst(
                     EsiInvalidationWriterService.quote(aclGroupTemporaryKe=
y), //make sure it's un-regexed
                     aclGroupFinalKey);
             newFrg.setAbsoluteKeyHeader(absoluteHeader);
-
+            }
             //now we can remove the old node
             cache.remove(frgTempNodeKey);
 =


Modified: trunk/core/src/java/org/jahia/taglibs/esi/JesiBodyTag.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/taglibs/esi/JesiBodyTag.java&rev=3D17988&repname=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/taglibs/esi/JesiBodyTag.java (original)
+++ trunk/core/src/java/org/jahia/taglibs/esi/JesiBodyTag.java Thu Jul 12 1=
9:16:37 2007
@@ -169,10 +169,7 @@
         //various sanity checks
         if(expiration =3D=3D null || expiration.equals(""))
         {
-            release();
-            throw new JspTagException(
-                JahiaResourceBundle.getResource("configuration", "org.jahi=
a.esi.expiration_null_empty", Jahia.getThreadParamBean().getLocale(), Jahia=
.getThreadParamBean())
-                );
+            expiration=3DJesiConst.UNSET;
         }
         if(maxRemovalDelay =3D=3D null || maxRemovalDelay.equals(""))
         {

Modified: trunk/core/src/webapp/WEB-INF/var/db/sql/schema/hypersonic/jahia-=
schema.sql
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/var/db/sql/schema/hypersonic/jahia-schema.sql&rev=3D17988&repname=
=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/var/db/sql/schema/hypersonic/jahia-schema=
.sql (original)
+++ trunk/core/src/webapp/WEB-INF/var/db/sql/schema/hypersonic/jahia-schema=
.sql Thu Jul 12 19:16:37 2007
@@ -392,9 +392,9 @@
 );
 create table jahia_link (
     id integer not null,
-    left_oid varchar(255),
-    right_oid varchar(255),
-    type varchar(255),
+    left_oid varchar(100),
+    right_oid varchar(100),
+    type varchar(100),
     primary key (id)
 );
 create table jahia_link_metadata (

Modified: trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mssql/jahia-schem=
a.sql
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/var/db/sql/schema/mssql/jahia-schema.sql&rev=3D17988&repname=3Djah=
ia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mssql/jahia-schema.sql =
(original)
+++ trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mssql/jahia-schema.sql =
Thu Jul 12 19:16:37 2007
@@ -389,9 +389,9 @@
 );
 create table jahia_link (
     id int not null,
-    left_oid nvarchar(255) null,
-    right_oid nvarchar(255) null,
-    type nvarchar(255) null,
+    left_oid nvarchar(100) null,
+    right_oid nvarchar(100) null,
+    type nvarchar(100) null,
     primary key (id)
 );
 create table jahia_link_metadata (

Modified: trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mysql/jahia-schem=
a.sql
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/var/db/sql/schema/mysql/jahia-schema.sql&rev=3D17988&repname=3Djah=
ia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mysql/jahia-schema.sql =
(original)
+++ trunk/core/src/webapp/WEB-INF/var/db/sql/schema/mysql/jahia-schema.sql =
Thu Jul 12 19:16:37 2007
@@ -389,9 +389,9 @@
 );
 create table jahia_link (
     id integer not null,
-    left_oid varchar(255),
-    right_oid varchar(255),
-    type varchar(255),
+    left_oid varchar(100),
+    right_oid varchar(100),
+    type varchar(100),
     primary key (id)
 );
 create table jahia_link_metadata (

Modified: trunk/core/src/webapp/WEB-INF/var/db/sql/schema/oracle/jahia-sche=
ma.sql
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/var/db/sql/schema/oracle/jahia-schema.sql&rev=3D17988&repname=3Dja=
hia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/var/db/sql/schema/oracle/jahia-schema.sql=
 (original)
+++ trunk/core/src/webapp/WEB-INF/var/db/sql/schema/oracle/jahia-schema.sql=
 Thu Jul 12 19:16:37 2007
@@ -336,9 +336,9 @@
 );
 create table jahia_link (
     id number(10,0) not null,
-    left_oid varchar2(255),
-    right_oid varchar2(255),
-    type varchar2(255),
+    left_oid varchar2(100),
+    right_oid varchar2(100),
+    type varchar2(100),
     primary key (id)
 );
 create table jahia_link_metadata (

Modified: trunk/core/src/webapp/WEB-INF/var/db/sql/schema/postgresql/jahia-=
schema.sql
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/webapp=
/WEB-INF/var/db/sql/schema/postgresql/jahia-schema.sql&rev=3D17988&repname=
=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/webapp/WEB-INF/var/db/sql/schema/postgresql/jahia-schema=
.sql (original)
+++ trunk/core/src/webapp/WEB-INF/var/db/sql/schema/postgresql/jahia-schema=
.sql Thu Jul 12 19:16:37 2007
@@ -389,9 +389,9 @@
 );
 create table jahia_link (
     id int4 not null,
-    left_oid varchar(255),
-    right_oid varchar(255),
-    type varchar(255),
+    left_oid varchar(100),
+    right_oid varchar(100),
+    type varchar(100),
     primary key (id)
 );
 create table jahia_link_metadata (

_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list

Reply via email to