You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by mi...@apache.org on 2006/01/21 03:43:38 UTC
svn commit: r370967 -
/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java
Author: mikem
Date: Fri Jan 20 18:43:36 2006
New Revision: 370967
URL: http://svn.apache.org/viewcvs?rev=370967&view=rev
Log:
DERBY-757
Now that this routine can be called while concurrently with XA transactions
being created and committed, checks have to be made to make sure the object
being searched for does not go null while we are looking at it. The search
is for existing xacts, so skipping when we find a null is fine.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java?rev=370967&r1=370966&r2=370967&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java Fri Jan 20 18:43:36 2006
@@ -337,10 +337,10 @@
/**
* Find a transaction in the table by Global transaction id.
* <p>
- * Only called by XactXAResourceManager.find() during offline recovery
- * of in-doubt transactions, we do not expect this to be called often
- * so performance is not critical. Just to linear search of id's.
- * <p>
+ * This routine use to be only called during offline recovery so performance
+ * was not critical. Since that time more calls have been made, including
+ * one in startGlobalTransaction() so a linear search may no longer
+ * be appropriate. See DERBY-828.
*
* @return The ContextManager of the transaction being searched for.
*
@@ -359,11 +359,15 @@
TransactionTableEntry entry =
(TransactionTableEntry) e.nextElement();
- if (entry.getGid() != null &&
- entry.getGid().equals(global_id))
+ if (entry != null)
{
- cm = entry.getXact().getContextManager();
- break;
+ GlobalTransactionId entry_gid = entry.getGid();
+
+ if (entry_gid != null && entry_gid.equals(global_id))
+ {
+ cm = entry.getXact().getContextManager();
+ break;
+ }
}
}
}