[jbpm-commits] JBoss JBPM SVN: r4662 - jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Apr 29 04:07:56 EDT 2009


Author: tom.baeyens at jboss.com
Date: 2009-04-29 04:07:56 -0400 (Wed, 29 Apr 2009)
New Revision: 4662

Modified:
   jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java
Log:
fixed deployment serialization problem in Lob

Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java	2009-04-29 07:30:59 UTC (rev 4661)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java	2009-04-29 08:07:56 UTC (rev 4662)
@@ -21,6 +21,7 @@
  */
 package org.jbpm.pvm.internal.lob;
 
+import java.io.ObjectStreamException;
 import java.io.Serializable;
 import java.util.List;
 
@@ -48,6 +49,7 @@
   protected byte[] bytes = null;
   protected List<BytesChop> bytesChops = null;
   
+  protected char[] cachedChars = null;
   protected java.sql.Clob clob = null;
   protected String text = null;
   protected List<CharChop> charChops = null;
@@ -61,10 +63,12 @@
   }
   
   public Lob(byte[] bytes) {
+    cachedBytes = bytes;
     getBlobStrategy().set(bytes, this);
   }
 
   public Lob(char[] text) {
+    cachedChars = text;
     getClobStrategy().set(text, this);
   }
 
@@ -103,4 +107,22 @@
     
     return blobStrategy;
   }
+  
+  protected Object readResolve() throws ObjectStreamException {
+    if (cachedBytes!=null) {
+      getBlobStrategy().set(cachedBytes, this);
+    }
+    if (cachedChars!=null) {
+      getClobStrategy().set(cachedChars, this);
+    }
+    return this;
+  }
+
+  protected Object writeReplace() throws ObjectStreamException {
+    blob = null;
+    clob = null;
+    return this;
+  }
+
+  
 }




More information about the jbpm-commits mailing list