<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css><!-- DIV {margin:0px;} --></STYLE>

<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2>I agree with the sentiment regarding threads. If we 
implement #2 (parallel SQL query execution) I want mondrian to be able to run in 
a mode where everything is done in one thread.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2>(If you read my&nbsp;blog post <A 
href="http://julianhyde.blogspot.com/2006/12/its-not-often-that-i-am-criticized-for.html">What's 
in a name</A>, you will&nbsp;know that I am militantly agnostic on whether 
mondrian is a server. A repository is one sure sign that a software library is 
growing into a server, but a thread pool is another.)&nbsp;</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2>When we do allocate threads, we will use 
java.util.concurrent.ThreadFactory - that should give enough flexibility for 
various environments. (I have a feeling that ThreadFactory was introduced 
because people wanted a safe way to create threads inside their EJBs, so we can 
use if for the same purpose.)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2>I want to challenge Michael's assertion that "<FONT 
face="Times New Roman" color=#000000 size=3>almost no JDBC driver will allow 
parallel queries</FONT>". It may be true, but if so, it will cost us a lot of 
effort to do things another way, so I want to see some evidence. Michael, can 
you give&nbsp;an example of a JDBC driver which cannot execute two statements in 
the same connection (and transaction context)?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2>Julian</FONT>&nbsp;</SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=343344222-13022007><FONT face=Verdana 
color=#000080 size=2></FONT></SPAN>&nbsp;</DIV><BR>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> mondrian-bounces@pentaho.org 
  [mailto:mondrian-bounces@pentaho.org] <B>On Behalf Of </B>michael 
  bienstein<BR><B>Sent:</B> Tuesday, February 13, 2007 2:08 PM<BR><B>To:</B> 
  Mondrian developer mailing list<BR><B>Subject:</B> Re : [Mondrian] 
  Multi-threading SQL execution<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV 
  style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
  <DIV 
  style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">Matt,<BR><BR>The 
  reason that threads shouldn't be created in Servlets is conceptually 
  simple.&nbsp; Servlets run in a managed environment.&nbsp; The control over 
  the usage of system resources should be handled by the environment without 
  interference from applications being managed.&nbsp; Threads are one of those 
  resources.&nbsp; To give an idea of this, there is actually no restriction on 
  the number of Threads you create in Java.&nbsp; However if you go over 8 
  threads per CPU you get serious performance degradation because of the 
  switching the CPU has to do between the threads (at least on Windows Sun JDK 
  1.4).&nbsp; So it's better if you set up your application server and configure 
  how many threads get used for all the applications in the same JVM and no 
  application changes this.<BR><BR>More generally, Java has very bad semantics 
  for enforcing this sort of control over system resources.&nbsp; Consider 
  memory.&nbsp; I didn't know that Java 5 allowed some control over this as 
  Richard has shown us recently.&nbsp; Look at the problems though: Derby runs 
  in the same JVM as Mondrian and all of a sudden we get lots of failures 
  because we are told that we're running out of memory.&nbsp; How can you limit 
  how much memory a WAR can use?&nbsp; You can't.&nbsp; With File access you 
  probably could do it with a custom SecurityManager.&nbsp; With Threads that's 
  probably true too, but no major app server does it.<BR><BR>The second reason 
  has nothing to do with Mondrian.&nbsp; EJB 1 and 2 focussed on being able to 
  call business logic without worrying about where that logic was 
  implemented.&nbsp; It could be in a different JVM or even on another 
  computer.&nbsp; Using threads (or static variables) is therefore forbidden 
  even though if you know you are only running locally then it will still all 
  work.<BR><BR>Lastly, I know commercial BI software that *breaks* this rule and 
  launches a thread in a Servlet init() method.&nbsp; It is truly astounding how 
  many bad things pop up when the language or framework doesn't constrain 
  you.<BR><BR>Michael<BR><BR>PS: Congrats on 2.3 feature complete.&nbsp; Really 
  happy to see cache flushing in there.&nbsp; But did Bart's bug on virtual cube 
  get fixed?&nbsp; I'm really curious as to what causes it.<BR></DIV></DIV><BR>
  <HR SIZE=1>
  Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
  Profitez des connaissances, des opinions et des expériences des internautes 
  sur <A 
  href="http://fr.rd.yahoo.com/evt=42054/*http://fr.answers.yahoo.com">Yahoo! 
  Questions/Réponses</A>.</BLOCKQUOTE></BODY></HTML>