geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: svn commit: r232975 - /geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionImpl.java
Date Tue, 16 Aug 2005 15:05:19 GMT
Can you provide some justification for this?  Unless you have  
implemented some very special XAResource where toString returns the  
same name no matter which vm you are running in, whenever you start the  
server, this breaks recovery.  -1 without discussion and convincing me  
this will lead to greater stability and more reliable recovery.

thanks
david jencks

On Aug 16, 2005, at 3:28 AM, jstrachan@apache.org wrote:

> Author: jstrachan
> Date: Tue Aug 16 03:28:43 2005
> New Revision: 232975
>
> URL: http://svn.apache.org/viewcvs?rev=232975&view=rev
> Log:
> added a helper method to avoid ClassCastException when using Geronimo  
> TransactionManager with regular, non-wrapped XAResource instances
>
> Modified:
>      
> geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/ 
> transaction/manager/TransactionImpl.java
>
> Modified:  
> geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/ 
> transaction/manager/TransactionImpl.java
> URL:  
> http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/ 
> java/org/apache/geronimo/transaction/manager/TransactionImpl.java? 
> rev=232975&r1=232974&r2=232975&view=diff
> ======================================================================= 
> =======
> ---  
> geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/ 
> transaction/manager/TransactionImpl.java (original)
> +++  
> geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/ 
> transaction/manager/TransactionImpl.java Tue Aug 16 03:28:43 2005
> @@ -631,12 +631,26 @@
>          return manager;
>      }
>
> +    /**
> +     * A helper method to convert an {@link XAResource} into a {@link  
> NamedXAResource}
> +     * either via casting or wrapping.
> +     */
> +    protected static NamedXAResource asNamedXAResource(XAResource  
> xaRes) {
> +        if (xaRes instanceof NamedXAResource) {
> +            return (NamedXAResource) xaRes;
> +        }
> +        else {
> +            String name = xaRes.toString();
> +            return new WrapperNamedXAResource(xaRes, name);
> +        }
> +    }
> +
>      private static class TransactionBranch implements  
> TransactionBranchInfo {
>          private final NamedXAResource committer;
>          private final Xid branchId;
>
>          public TransactionBranch(XAResource xaRes, Xid branchId) {
> -            committer = (NamedXAResource)xaRes;
> +            committer = asNamedXAResource(xaRes);
>              this.branchId = branchId;
>          }
>
>
>


Mime
View raw message