db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r383587 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java
Date Mon, 06 Mar 2006 17:17:06 GMT
Author: djd
Date: Mon Mar  6 09:17:01 2006
New Revision: 383587

URL: http://svn.apache.org/viewcvs?rev=383587&view=rev
Log:
Add some javadoc comments to methods in ContextService.java

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java?rev=383587&r1=383586&r2=383587&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/context/ContextService.java
Mon Mar  6 09:17:01 2006
@@ -171,7 +171,13 @@
 
 
 	/**
-	 * Get current Context Manager
+	 * Get current Context Manager linked to the current Thread.
+     * See setCurrentContextManager for details.
+     * Note that this call can be expensive and is only
+     * intended to be used in "stateless" situations.
+     * Ideally code has a reference to the correct
+     * ContextManager from another Object, such as a pushed Context.
+     * 
 	 * @return ContextManager current Context Manager
 	 */
 	public ContextManager getCurrentContextManager() {
@@ -218,6 +224,11 @@
 		return null;
 */	}
 
+    /**
+     * Break the link between the current Thread and the passed
+     * in ContextManager. Called in a pair with setCurrentContextManager,
+     * see that method for details.
+     */
 	public void resetCurrentContextManager(ContextManager cm) {
 		ThreadLocal tcl = threadContextList;
 
@@ -348,6 +359,28 @@
 	}
 
 	/**
+     * Link the current thread to the passed in Contextmanager
+     * so that a subsequent call to getCurrentContextManager by
+     * the current Thread will return cm.
+     * ContextManagers are tied to a Thread while the thread
+     * is executing Derby code. For example on most JDBC method
+     * calls the ContextManager backing the Connection object
+     * is tied to the current Thread at the start of the method
+     * and reset at the end of the method. Once the Thread
+     * has completed its Derby work the method resetCurrentContextManager
+     * must be called with the same ContextManager to break the link.
+     * Note that a subsquent use of the ContextManager may be on
+     * a separate Thread, the Thread is only linked to the ContextManager
+     * between the setCurrentContextManager and resetCurrentContextManager calls.
+     * <BR>
+     * ContextService supports nesting of calls by a single Thread, either
+     * with the same ContextManager or a different ContextManager.
+     * <UL>
+     * <LI>The same ContextManager would be pushed during a nested JDBC call in
+     * a procedure or function.
+     * <LI>A different ContextManager would be pushed during a call on
+     * a different embedded JDBC Connection in a procedure or function.
+     * </UL>
 	 */
 	public void setCurrentContextManager(ContextManager cm) {
 



Mime
View raw message