db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1063109 - in /db/derby/code/branches/10.4: ./ java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Date Tue, 25 Jan 2011 02:36:54 GMT
Author: kmarsden
Date: Tue Jan 25 02:36:53 2011
New Revision: 1063109

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


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

Propchange: db/derby/code/branches/10.4/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 25 02:36:53 2011
@@ -1,3 +1,3 @@
 /db/derby/code/branches/10.5:814216,958230
 /db/derby/code/branches/10.6:1055601
-/db/derby/code/trunk:788436,793588,794303,796316,796372,797147,798347,798742,800523,803548,805696,809643,812669,816536,835286,882732,898635,915177,915733,917771,928065,934996,946794,954544,958163,958230,959550,980684,999119,1053724,1057542
+/db/derby/code/trunk:788436,793588,794303,796316,796372,797147,798347,798742,800523,803548,805696,809643,812669,816536,835286,882732,898635,915177,915733,917771,928065,934996,946794,954544,958163,958230,959550,980684,999119,1053724,1057542,1062096

Modified: db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=1063109&r1=1063108&r2=1063109&view=diff
==============================================================================
--- db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
(original)
+++ db/derby/code/branches/10.4/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Tue Jan 25 02:36:53 2011
@@ -624,14 +624,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