[jbpm-commits] JBoss JBPM SVN: r3824 - in jbpm4/trunk/modules: pvm/src/main/java/org/jbpm/pvm/internal/wire/binding and 4 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Feb 10 06:18:35 EST 2009


Author: tom.baeyens at jboss.com
Date: 2009-02-10 06:18:35 -0500 (Tue, 10 Feb 2009)
New Revision: 3824

Removed:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/LobCached.java
Modified:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml
   jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml
   jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/variables/VariableBasicTypesTest.java
   jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml
Log:
JBPM-2032 verified blob caching

Deleted: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/LobCached.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/LobCached.java	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/LobCached.java	2009-02-10 11:18:35 UTC (rev 3824)
@@ -1,34 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.pvm.internal.lob;
-
-
-/** only diff with Lob is that this class will be cached in the second 
- * level cache of hibernate.
- * 
- * @author Tom Baeyens
- */
-public class LobCached extends Lob {
-
-  private static final long serialVersionUID = 1L;
-
-}

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/HibernateConfigurationBinding.java	2009-02-10 11:18:35 UTC (rev 3824)
@@ -132,16 +132,13 @@
 
     // [hb] parse external configuration file or use inlined elements
     // but for no, it's one or the other to avoid side effects and overlays
-    if(element.hasAttribute("resource"))
-    {
+    if(element.hasAttribute("resource")) {
       parseConfigurationFile(element, descriptor);
-      log.info("Configuring form external resource "+element.getAttribute("resource")+
-          ", skip inline configuration elements.");
+      log.info("Configuring form external resource "+element.getAttribute("resource"));
     }
-    else
-    {
-      parseInlineConfiguration(element, parse, descriptor, parser);
-    }
+    
+    parseInlineConfiguration(element, parse, descriptor, parser);
+    
     return descriptor;
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateConfigurationDescriptor.java	2009-02-10 11:18:35 UTC (rev 3824)
@@ -86,24 +86,21 @@
     Configuration configuration = (Configuration) object;
 
     // [hb] use one or the other for now, but don't mix external and inline configuration
-    if(hibernateConfigResource!=null)
-    {
+    if(hibernateConfigResource!=null) {
       configuration.configure(hibernateConfigResource);
     }
-    else
-    {
-      apply(mappingOperations, configuration, wireContext);
-      apply(cacheOperations, configuration, wireContext);
+    
+    apply(mappingOperations, configuration, wireContext);
+    apply(cacheOperations, configuration, wireContext);
 
-      if (propertiesDescriptor!=null) {
-        Properties properties = (Properties) wireContext.create(propertiesDescriptor, false);
-        if (log.isDebugEnabled()) log.debug("adding properties to hibernate configuration: "+properties);
-        configuration.addProperties(properties);
-      }
+    if (propertiesDescriptor!=null) {
+      Properties properties = (Properties) wireContext.create(propertiesDescriptor, false);
+      if (log.isDebugEnabled()) log.debug("adding properties to hibernate configuration: "+properties);
+      configuration.addProperties(properties);
+    }
 
-      if (schemaOperation != null) {
-        schemaOperation.apply(configuration, wireContext);
-      }
+    if (schemaOperation != null) {
+      schemaOperation.apply(configuration, wireContext);
     }
   }
 

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.cache.xml	2009-02-10 11:18:35 UTC (rev 3824)
@@ -15,6 +15,7 @@
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.activities" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.variableDefinitions" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.timerDefinitions" />
+  <collection-cache collection="org.jbpm.pvm.internal.model.ProcessDefinitionImpl.attachments" />
 
 	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.exceptionHandlers" />
 	<collection-cache collection="org.jbpm.pvm.internal.model.ActivityImpl.events" />

Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.pvm.definition.hbm.xml	2009-02-10 11:18:35 UTC (rev 3824)
@@ -79,7 +79,7 @@
         <column name="PROCESS_" index="IDX_LOB_PROCESS" />
       </key>
       <map-key type="string" column="NAME_" />
-      <one-to-many class="org.jbpm.pvm.internal.lob.LobCached"/>
+      <one-to-many class="org.jbpm.pvm.internal.lob.Lob"/>
     </map>
   </class>
 
@@ -349,18 +349,6 @@
         
   </class>
 
-  <!-- ### LOB ############################################################ -->
-  <class name="org.jbpm.pvm.internal.lob.LobCached" table="JBPM_LOB">
-    <id name="dbid" column="DBID_">
-      <generator class="native" />
-    </id>
-    <version name="dbversion" column="DBVERSION_" />
-    <property name="blob" type="blob" column="BLOB_VALUE_" />
-    <property name="bytes" type="binary" column="BINARY_VALUE_"/>
-    <property name="clob" type="clob" column="CLOB_VALUE_" />
-    <property name="text" type="text" column="TEXT_VALUE_"/>
-  </class>
-
   <!-- ### VARIABLE DEFINITION ############################################ -->
   <class name="VariableDefinitionImpl" table="JBPM_VARIABLEDEF">
     <id name="dbid" column="DBID_">

Modified: jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/variables/VariableBasicTypesTest.java
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/variables/VariableBasicTypesTest.java	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/test-db/src/main/java/org/jbpm/test/variables/VariableBasicTypesTest.java	2009-02-10 11:18:35 UTC (rev 3824)
@@ -117,7 +117,14 @@
   }
   
   public void testVariableTypeSerializable() {
-    checkVariableValue(new SerializeMe(generateString("a lot of text ", 500)));
+    SerializeMe originalValue = new SerializeMe(generateString("a lot of text ", 500));
+    checkVariableValue(originalValue);
+    
+    // now check if an update still works ok
+    // updating a serialized object might fail when the blob is cached by hibernate
+    SerializeMe newValue = new SerializeMe(generateString("another text ", 500));
+    executionService.setVariable("var/one", "msg", newValue);
+    assertEquals(newValue, executionService.getVariable("var/one", "msg"));
   }
   
   protected String generateString(String base, int multiplier) {

Modified: jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml	2009-02-10 07:43:34 UTC (rev 3823)
+++ jbpm4/trunk/modules/test-db/src/main/resources/jbpm.cfg.xml	2009-02-10 11:18:35 UTC (rev 3824)
@@ -25,7 +25,10 @@
       <standard-transaction-interceptor />
     </command-service>
     
-    <hibernate-configuration resource="testDb-hibernate.cfg.xml"/>     
+    <hibernate-configuration resource="testDb-hibernate.cfg.xml">     
+      <cache-configuration resource="jbpm.pvm.cache.xml" 
+                           usage="nonstrict-read-write" />
+    </hibernate-configuration>
     
     <hibernate-session-factory />
     




More information about the jbpm-commits mailing list