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; }
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.
Can't use replaceAll, though, as it is not available in JDK1.3 :(
Using replace instead and will only apply this to the file stores...
I have fixed this in the file stores. Could you check if it works for you?