You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by re...@apache.org on 2001/03/24 06:17:42 UTC

cvs commit: jakarta-slide/src/stores/slidestore/mysql MySQLContentStore.java MySQLDescriptorsStore.java

remm        01/03/23 21:17:42

  Modified:    src/stores/slidestore/mysql MySQLContentStore.java
                        MySQLDescriptorsStore.java
  Log:
  - Don't call directly the superclass. Filter out the XAException which is thrown
    when the JDBC transaction control call fails.
  
  Revision  Changes    Path
  1.2       +22 -7     jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java
  
  Index: MySQLContentStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MySQLContentStore.java	2001/03/24 05:10:03	1.1
  +++ MySQLContentStore.java	2001/03/24 05:17:40	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java,v 1.1 2001/03/24 05:10:03 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/03/24 05:10:03 $
  + * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLContentStore.java,v 1.2 2001/03/24 05:17:40 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/03/24 05:17:40 $
    *
    * ====================================================================
    *
  @@ -91,7 +91,7 @@
    * used with version 3.22 and older of MySQL.
    *
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   public class MySQLContentStore extends JDBCContentStore {
       
  @@ -110,7 +110,12 @@
        */
       public void commit(Xid xid, boolean onePhase)
           throws XAException {
  -        super.commit(xid, onePhase);
  +        try {
  +            super.commit(xid, onePhase);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XA_RBCOMMFAIL)
  +                throw e;
  +        }
       }
       
       
  @@ -120,7 +125,12 @@
        */
       public void rollback(Xid xid)
           throws XAException {
  -        super.rollback(xid);
  +        try {
  +            super.rollback(xid);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XA_HEURCOM)
  +                throw e;
  +        }
       }
       
       
  @@ -129,7 +139,12 @@
        */
       public void start(Xid xid, int flags)
           throws XAException {
  -        super.start(xid, flags);
  +        try {
  +            super.start(xid, flags);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XAER_RMERR)
  +                throw e;
  +        }
       }
       
       
  
  
  
  1.2       +22 -7     jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java
  
  Index: MySQLDescriptorsStore.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MySQLDescriptorsStore.java	2001/03/24 05:10:04	1.1
  +++ MySQLDescriptorsStore.java	2001/03/24 05:17:41	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java,v 1.1 2001/03/24 05:10:04 remm Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/03/24 05:10:04 $
  + * $Header: /home/cvs/jakarta-slide/src/stores/slidestore/mysql/MySQLDescriptorsStore.java,v 1.2 2001/03/24 05:17:41 remm Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/03/24 05:17:41 $
    *
    * ====================================================================
    *
  @@ -86,7 +86,7 @@
    * used with version 3.22 and older of MySQL.
    * 
    * @author <a href="mailto:remm@apache.org">Remy Maucherat</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */
   
   public class MySQLDescriptorsStore extends JDBCDescriptorsStore {
  @@ -106,7 +106,12 @@
        */
       public void commit(Xid xid, boolean onePhase)
           throws XAException {
  -        super.commit(xid, onePhase);
  +        try {
  +            super.commit(xid, onePhase);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XA_RBCOMMFAIL)
  +                throw e;
  +        }
       }
       
       
  @@ -116,7 +121,12 @@
        */
       public void rollback(Xid xid)
           throws XAException {
  -        super.rollback(xid);
  +        try {
  +            super.rollback(xid);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XA_HEURCOM)
  +                throw e;
  +        }
       }
       
       
  @@ -125,7 +135,12 @@
        */
       public void start(Xid xid, int flags)
           throws XAException {
  -        super.start(xid, flags);
  +        try {
  +            super.start(xid, flags);
  +        } catch (XAException e) {
  +            if (e.errorCode != XAException.XAER_RMERR)
  +                throw e;
  +        }
       }