db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1063145 - in /db/derby/code/branches/10.3: ./ java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Date Tue, 25 Jan 2011 05:49:23 GMT
Author: kmarsden
Date: Tue Jan 25 05:49:23 2011
New Revision: 1063145

URL: http://svn.apache.org/viewvc?rev=1063145&view=rev
Log:
DERBY-4973 NullPointerException in updatelocks.sql encryption tests on IBM 1.6


Modified:
    db/derby/code/branches/10.3/   (props changed)
    db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java

Propchange: db/derby/code/branches/10.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 25 05:49:23 2011
@@ -1,2 +1,2 @@
 /db/derby/code/branches/10.6:1055601
-/db/derby/code/trunk:552046,586313,586317,788436,793588,794303,796316,796372,798347,798742,800523,803548,816536,882732,915177,917771,946794,958163
+/db/derby/code/trunk:552046,586313,586317,788436,793588,794303,796316,796372,798347,798742,800523,803548,816536,882732,915177,917771,946794,958163,1062096

Modified: db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=1063145&r1=1063144&r2=1063145&view=diff
==============================================================================
--- db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
(original)
+++ db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Tue Jan 25 05:49:23 2011
@@ -608,14 +608,17 @@ public class Xact extends RawTransaction
 		return myId;
 	}
 
-	/**
-		Get my transaction context Id
-	*/
-	public final String getContextId() 
-	{
-		return (xc == null) ? null : xc.getIdName();
-	}
-
+    /**
+     * Get my transaction context Id
+     */
+    public final String getContextId() {
+        //DERBY-4973. Make a copy of xc so we are working on a stable 
+        // copy, especially for the lock table VTI. If we don't, there may
+        // be a chance for a NullPointerException if close() is called 
+        //by another thread after the check but before the dereference.
+        XactContext tempxc = xc;
+        return (tempxc == null) ? null : tempxc.getIdName();
+    }
 
 	/**
 		Get the current default locking policy for all operations within this



Mime
View raw message