db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r1062471 - in /db/derby/code/branches/10.7: ./ java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Date Sun, 23 Jan 2011 17:16:31 GMT
Author: kmarsden
Date: Sun Jan 23 17:16:31 2011
New Revision: 1062471

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

merge 1062096 from trunk


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

Propchange: db/derby/code/branches/10.7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 23 17:16:31 2011
@@ -1 +1 @@
-/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480
+/db/derby/code/trunk:1035603,1036769,1038514,1038813,1039084,1039268,1040658,1041338,1043227,1043389,1044096,1051026,1053724,1055169,1059888,1060480,1062096

Modified: db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=1062471&r1=1062470&r2=1062471&view=diff
==============================================================================
--- db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
(original)
+++ db/derby/code/branches/10.7/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
Sun Jan 23 17:16:31 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