geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r524651 - /geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java
Date Sun, 01 Apr 2007 18:25:51 GMT
Author: kevan
Date: Sun Apr  1 11:25:50 2007
New Revision: 524651

URL: http://svn.apache.org/viewvc?view=rev&rev=524651
Log:
Add null guard when processing prepared xa resources. Seems that the upgraded derby can return
null on a recover() call, rather than a 0 length array

Modified:
    geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java

Modified: geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java?view=diff&rev=524651&r1=524650&r2=524651
==============================================================================
--- geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java
(original)
+++ geronimo/server/trunk/modules/geronimo-transaction/src/main/java/org/apache/geronimo/transaction/manager/RecoveryImpl.java
Sun Apr  1 11:25:50 2007
@@ -93,7 +93,7 @@
     public synchronized void recoverResourceManager(NamedXAResource xaResource) throws XAException
{
         String name = xaResource.getName();
         Xid[] prepared = xaResource.recover(XAResource.TMSTARTRSCAN + XAResource.TMENDRSCAN);
-        for (int i = 0; i < prepared.length; i++) {
+        for (int i = 0; prepared != null && i < prepared.length; i++) {
             Xid xid = prepared[i];
             ByteArrayWrapper globalIdWrapper = new ByteArrayWrapper(xid.getGlobalTransactionId());
             XidBranchesPair xidNamesPair = (XidBranchesPair) ourXids.get(globalIdWrapper);



Mime
View raw message