Bug 30499 - Bug fix to run Slide on Weblogic
Summary: Bug fix to run Slide on Weblogic
Status: RESOLVED FIXED
Alias: None
Product: Slide
Classification: Unclassified
Component: Transaction Manager (show other bugs)
Version: Nightly
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-05 19:41 UTC by Christophe
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe 2004-08-05 19:41:13 UTC
Weblogic add characters like "'" or ":" in the thread name. Thoses  characters
can provide some issues for specific stores like the TxXMLFileDescriptorsStore
because this store is using the Xid name to create some folders. A small patch
is to drop those characters when a new SlideXid is instantiated.


Here is the patch for SlideTransaction : 

Index: SlideTransaction.java
===================================================================
RCS file:
/home/cvspublic/jakarta-slide/src/share/org/apache/slide/transaction/SlideTransaction.java,v
retrieving revision 1.23
diff -u -r1.23 SlideTransaction.java
--- SlideTransaction.java	28 Jul 2004 09:34:33 -0000	1.23
+++ SlideTransaction.java	5 Aug 2004 19:31:11 -0000
@@ -1,7 +1,7 @@
 /*
- * $Header:
/home/cvspublic/jakarta-slide/src/share/org/apache/slide/transaction/SlideTransaction.java,v
1.23 2004/07/28 09:34:33 ib Exp $
- * $Revision: 1.23 $
- * $Date: 2004/07/28 09:34:33 $
+ * $Header:
/home/cvspublic/jakarta-slide/src/share/org/apache/slide/transaction/SlideTransaction.java,v
1.22 2004/02/19 16:58:26 ozeigermann Exp $
+ * $Revision: 1.22 $
+ * $Date: 2004/02/19 16:58:26 $
  *
  * ====================================================================
  *
@@ -69,10 +69,7 @@
         globalCreatedTransactions++;
         currentTransactionNumber  = globalCreatedTransactions;
         currentThreadName         = Thread.currentThread().getName();
-        xid = new SlideXid
-            ((currentThreadName + "-" + System.currentTimeMillis() + "-"
-                  + currentTransactionNumber).getBytes(),
-             0, new byte[0]);
+        xid = new SlideXid(this.getName().getBytes(), 0, new byte[0]);
         this.transactionManager = transactionManager;
     }
     
@@ -708,6 +705,18 @@
             + " xid " + xid + " in thread " + currentThreadName +
             (currentThreadName.equals(Thread.currentThread().getName())?"":
                  " current= " + Thread.currentThread().getName());
+    }
+    
+    /**
+     *  Get the Xid name based on the threadName
+     */
+    public String getName()
+    {
+        // Some application servers like weblogic add characters like ' or : in
the thread name.
+        // Thoses  character can gives issues for specific stores like the
TxXMLFileDescriptorsStore
+        // This store is using the Xid name to create some folders. So, drop
thoses characters
+        String currentThreadName =
Thread.currentThread().getName().replaceAll("'", "").replaceAll(":", "");
+        return currentThreadName + "-" + System.currentTimeMillis() + "-" +
currentTransactionNumber;
     }
Comment 1 Oliver Zeigermann 2004-08-09 08:00:13 UTC
Right. I already had something like this, but must have messed it up with the
switch to commons transactions. I will take care of this ASAP.
Comment 2 Oliver Zeigermann 2004-08-09 08:10:23 UTC
Can't use replaceAll, though, as it is not available in JDK1.3 :(
Comment 3 Oliver Zeigermann 2004-08-09 08:11:15 UTC
Using replace instead and will only apply this to the file stores...
Comment 4 Oliver Zeigermann 2004-08-09 09:37:31 UTC
I have fixed this in the file stores. Could you check if it works for you?