Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 15694 invoked from network); 21 Jan 2008 14:11:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2008 14:11:58 -0000 Received: (qmail 89540 invoked by uid 500); 21 Jan 2008 14:11:48 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 89499 invoked by uid 500); 21 Jan 2008 14:11:47 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 89457 invoked by uid 99); 21 Jan 2008 14:11:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2008 06:11:47 -0800 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.18.43.132] (HELO sca-es-mail-1.sun.com) (192.18.43.132) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Jan 2008 14:11:20 +0000 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-1.sun.com (8.13.7+Sun/8.12.9) with ESMTP id m0LEBPli008110 for ; Mon, 21 Jan 2008 06:11:26 -0800 (PST) Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) id <0JUZ00401ZBHOX00@fe-sfbay-10.sun.com> (original mail from Richard.Hillegas@Sun.COM) for derby-dev@db.apache.org; Mon, 21 Jan 2008 06:11:25 -0800 (PST) Received: from richard-hillegas-computer.local ([129.150.16.199]) by fe-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-8.04 (built Feb 28 2007)) with ESMTPSA id <0JUZ00B5IZF13C80@fe-sfbay-10.sun.com> for derby-dev@db.apache.org; Mon, 21 Jan 2008 06:11:25 -0800 (PST) Date: Mon, 21 Jan 2008 06:12:09 -0800 From: Rick Hillegas Subject: Re: Getting the LangaugeConnectionContext In-reply-to: <6b47fb310801202211k6586cdb0je0893416c4da778c@mail.gmail.com> Sender: Richard.Hillegas@Sun.COM To: derby-dev@db.apache.org Message-id: <4794A839.6060305@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: <6b47fb310801200342q7dc18086n29b3bf4da484e01f@mail.gmail.com> <479340A6.6040200@sun.com> <6b47fb310801202211k6586cdb0je0893416c4da778c@mail.gmail.com> User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) X-Virus-Checked: Checked by ClamAV on apache.org Jazarine Jamal wrote: > Really thanks for the reply... > > > > Is it possible to get the LCC at some later point of execution : in > the JDBCDisplayUtil? > > I have got the Connection object in the function that i need. I want > to if its possible to get the activation object related to the current > connection. > > By the way, why is that getCurrentLCC() throws an error when used in > JDBCDisplayUtil but not when it is used in classes such as > ConsistencyChecker, etc..? Hi Jazarine, The LanguageConnectionContext is the root of the SQL interpreter's state variable for a session. That is, the LCC is used to cache all sorts of information needed to parse, optimize, and execute queries. The LCC is a structure which only exists in the Derby engine layer, that is, it is only visible to code that is running on the server side of a JDBC connection. JDBCDisplayUtil is tools code which runs outside the engine on the client side of a JDBC connection. JDBCDisplayUtil can run across the network in a remote client. In that remote layer, the LCC does not exist. In contrast, ConsistencyChecker runs inside the engine. Hope this helps, -Rick > > > > On Jan 20, 2008 6:07 PM, Thomas Nielsen < Thomas.Nielsen@sun.com > > wrote: > > Hi Jazarine, > > I'm assuming you need to get the LCC once you are in the execute > phase, > and in a class implementing ResultSet. All the different ResultSet > implementations in org.apache.derby.impl.sql.execute get an > activation > supplied to their constructor either directly, or through its > source/child ResultSet. It should hence be available either: > - as a member of the given ResultSet class > - though the ResultSets source/child ResultSet > - through getLanguageConnectionContext() > - or through getActivation().getLanguageConnectionContext() > depending on the ResultSet class implementation you are in. > > It could be beneficial to have a look around > ProjectRestrictNodeResultSet, the top-most ResultSet for a SELECT qry, > and see how it's fetched/used? > > Activations are created/built with an ActivationClassBuilder and is > populated during the bytecode generation phase. You can see one > example > of how the ActivationClassBuilder is used in > ProjectRestrictNode.generateMinion() in > org.apache.derby.impl.sql.compile. ProjectRestrictNode is the node > generating the ProjectRestrictNodeResultSet (and a few others for the > sake of correctness). > Generally we push objects to the stack, then call to > ActivationClassBuilder to push generation of the correct type of > ResultSet on the stack. This is where the actual Activation object is > created, and as previously stated it's often pushed as a parameter to > the ResultSet constructor. Once code generation is completed, we start > executing the generated bytecode. Someone with a little more > knowledge > of the details may want to explain this further, or correct me, if > necessary? :) > > Hope this helps you figure it out :) > > Thomas > > Jazarine Jamal wrote: > > I need to get the langaugeconnectioncontext. > > I presume it can be done through this: > > > > > LangaugeConnectionContext=activation.getLangaugeConnectionContext() > > > > > > > > But How do I create an Activation object? Are there any implemented > > classes for Activation interface..?? > > I am doing this since it forms a part of the code to get the type of > > an object. > > > > > > Please get me some help as soon as possible.. > >