db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r587034 - /db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
Date Mon, 22 Oct 2007 08:43:48 GMT
Author: kahatlen
Date: Mon Oct 22 01:43:47 2007
New Revision: 587034

URL: http://svn.apache.org/viewvc?rev=587034&view=rev
Log:
DERBY-3093: Intermittent transaction failure caused by internal duplicate savepoint name for
triggers

Merged fix from trunk (revision 586956).

Modified:
    db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java

Modified: db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java?rev=587034&r1=587033&r2=587034&view=diff
==============================================================================
--- db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
(original)
+++ db/derby/code/branches/10.2/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
Mon Oct 22 01:43:47 2007
@@ -99,6 +99,9 @@
 	*/
 	private short			sqlAllowed = -1;
 
+    // Counter used to create unique savepoint names.
+    private static long nextNameId = Long.MIN_VALUE;
+
 	/*
 	   constructor
 		@param tc transaction
@@ -109,7 +112,7 @@
 		this.lcc = lcc;
 		this.tc = tc;
 
-		internalSavePointName = "ISSP" + hashCode();
+        internalSavePointName = createInternalSavepointName();
 
 		if (SanityManager.DEBUG)
 		{
@@ -118,6 +121,16 @@
 		}
 
 	}
+
+    /**
+     * Generate a unique name for this savepoint.
+     * This method should only be called from the constructor.
+     *
+     * @return the savepoint name.
+     */
+    private synchronized static String createInternalSavepointName() {
+        return "ISSP" + nextNameId++;
+    }
 
     /**
      * This is a TimerTask that is responsible for timing out statements,



Mime
View raw message