Return-Path: Delivered-To: apmail-directory-dev-archive@www.apache.org Received: (qmail 16874 invoked from network); 12 Dec 2005 15:30:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 Dec 2005 15:30:25 -0000 Received: (qmail 77585 invoked by uid 500); 12 Dec 2005 15:30:23 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 77547 invoked by uid 500); 12 Dec 2005 15:30:23 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 77536 invoked by uid 99); 12 Dec 2005 15:30:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2005 07:30:23 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mboorshtein@gmail.com designates 64.233.184.198 as permitted sender) Received: from [64.233.184.198] (HELO wproxy.gmail.com) (64.233.184.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2005 07:30:22 -0800 Received: by wproxy.gmail.com with SMTP id i11so1760029wra for ; Mon, 12 Dec 2005 07:30:01 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=P2cb+9H/dpPhVe2W/oVv5okfLwaxy6gnaYxcC2SOOMRBGZvM8H7vqdLIA6cxb8pOW0+MrSoV25SzbIA27nd54THBt+6LVd1G/7bGjzc4IB3oP3d3iaL7wKGzSj9aREWVoN6Swrq3sZGlzNR4vKnr/0kKzwPJPzLGkNhp2V+LtcE= Received: by 10.54.156.2 with SMTP id d2mr895082wre; Mon, 12 Dec 2005 07:29:59 -0800 (PST) Received: by 10.54.137.18 with HTTP; Mon, 12 Dec 2005 07:29:59 -0800 (PST) Message-ID: <800df6390512120729u32564aecp81d629b5fa37f042@mail.gmail.com> Date: Mon, 12 Dec 2005 10:29:59 -0500 From: Marc Boorshtein To: Apache Directory Developers List Subject: Re: [ApacheDS][SP] Stored Procedure Languages In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1134376797.4013.1.camel@localhost.localdomain> <768dcb2e0512120116y64cef39cq@mail.gmail.com> <800df6390512120338w4cdfd59axdb2f4ec47c122831@mail.gmail.com> <800df6390512120414n373b7918ie9114007b7e499d0@mail.gmail.com> <800df6390512120445v323fa4a9j1ae46941dda017dc@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Well, thats not really a use case. For instance what is the use case for stored procs in a relational db? While there are many, the primary ones are: 1. Transaction Management - Being able to manage the business logic around a transaction in order to maintain the integrity of the data in the database. 2. Security - Often DBAs will only allow access to stored procs as opposed direct access to tables. It makes security that much easier. 3. Reporting - Often an SQL statement is not enough for a report (maybe some switching logic or parameter logic) There are more use-cases, but these are some of the most common.=20 Which of these apply to directories though? The other question relates to the interface. Applications which interact with databases are coded for a particuler schema (tables, views, stored procs...)=20 and so its reasonable to make the application call a stored procedure. Applications which hit directories for information are generally coded to either the ldapv3 standard or for a particuler directory or even a directory instance. While the extended operation is a part of the ldapv3 standard, there aren't many applications that use them. Marc On 12/12/05, Ersin Er wrote: > On 12/12/05, Marc Boorshtein wrote: > > Interesting. So what use-cases currently exist for the "Extended > > Operation" model for Stored Procs in a directory? > > What ever you want.. For example, for some run time configurations, > for some administrative scripts for collecting some statistics.. There > can be much more.. > > > Marc > > > > On 12/12/05, Ersin Er wrote: > > > On 12/12/05, Marc Boorshtein wrote: > > > > Sorry, should have said "Stored Procedure" or script. Will the > > > > scripts be executed by a particuler operation (ie an add is execute= d > > > > which executes a script) or will it be executed manually by some > > > > external mechanism? > > > > > > Oh OK. Stored Procedures provide a great selection of usages. First > > > what we do to provide excutable code in the server is publishing thes= e > > > stored procedures as extended operations. In fact we have only one > > > generic extended operation (say StoredProcedureExtendedOperation) > > > which accepts a call specification and executes the appropriate SP on > > > the server. Briefly, we are providing users the ability to "define > > > their own extended operations." > > > > > > SPs will also be used for Triggers. Triggers will be able to fire SPs > > > only. Say an Add operation will fire a SP (which will probably have t= o > > > implement an interface like AfterAddStoredProc) and appropriate > > > parameters in that context will be passed to the SP (via the method > > > forced by the interface). > > > > > > There are other usages of SP like scheduled tasks, etc. Finally I can > > > say that a stored procedure can be executed by a user or by an > > > operation automatically. This changes up to the context in which we > > > use them. But the Extended Operation mechanism is the main objective > > > now. > > > > > > Thanks for interest. > > > > > > > Marc > > > > > > > > On 12/12/05, Ersin Er wrote: > > > > > On 12/12/05, Marc Boorshtein wrote: > > > > > > Performance will probably be an issue with almost any scripting > > > > > > language that provides some more dynamic capabilities then java= . > > > > > > > > > > Of course. Just trying to choose a reasoable one. > > > > > > > > > > > Also, what are you planning to use as the mapping model? For > > > > > > instance, will it be a single method for eac operation or a met= hod for > > > > > > the input and one for the output? > > > > > > > > > > I'm not sure I exactly understand what you mean by mapping here. = We > > > > > have DIT based Java classes whose only one static method can be c= alled > > > > > as a stored procedure at a time. For scripting languages we may f= orce > > > > > the script (again in the DIT) to have a function/method with cert= ain > > > > > name (in case we cannot use reflection here) or we may use the sc= ript > > > > > as a whole. And for parameters we'll always use Java objects (and > > > > > primitives) and we will wrap them with any method required by the > > > > > scripting language and put in a context (as required by the scrip= ting > > > > > language) to be passed to the script. > > > > > > > > > > > Marc > > > > > > > > > > > > On 12/12/05, Trustin Lee wrote: > > > > > > > Hi all, > > > > > > > > > > > > > > 2005/12/12, Ersin Er : > > > > > > > > Hmm, OK. BeanShell seemed to be well integrated with Java b= ut > > > > > > > > performance is an important aspect of our choice. We many c= onsider > > > > > > > > using Mozilla Rhino. > > > > > > > > > > > > > > Rhino is a JavaScript engine with great performance and ease = of use, but > > > > > > > there's an issue with its license IIRC. There was a discussi= on on Rhino in > > > > > > > legal-discuss@apache.org, but this issue was not closed becau= se nobody gave > > > > > > > the bottom line. I don't think it is because this issue is r= esolved; I've > > > > > > > been reading legal-discuss list since it had started. > > > > > > > > > > > > > > If license becomes a problem, we could just use Groovy, which= is more > > > > > > > attractive option for Java developers. > > > > > > > > > > > > > > HTH, > > > > > > > Trustin > > > > > > > -- > > > > > > > what we call human nature is actually human habit > > > > > > > -- > > > > > > > http://gleamynode.net/ > > > > > > > > > > > > > > > > > > > > > -- > > > > > Ersin > > > > > > > > > > > > > > > > > > -- > > > Ersin > > > > > > > > -- > Ersin >