<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Actually, I am trying to implement dynamic role and it is not working,
so I am trying to understand why.<br>
<br>
At some point in the code I have my hierarchy topLevel and for this
level I need their members, then the following methods are called by
Pentaho:<br>
<br>
public List&lt;RolapMember&gt; getMembersInLevel<br>
    list =
rolapHierarchy.getMemberReader().getMembersInLevel(cubeLevel.getRolapLevel(),
startOrdinal, endOrdinal, constraint);<br>
        members = source.getMembersInLevel(level, startOrdinal,
endOrdinal, constraint);<br>
            getMembersInLevel(level, constraint);<br>
                final TupleList tupleList =
tupleReader.readTuples(dataSource, null, null);<br>
                    prepareTuples(jdbcConnection, partialResult,
newPartialResult);<br>
                        (...)<br>
                        stmt = RolapUtil.executeQuery(<br>
                            dataSource, sql, types, maxRows, 0,<br>
                            new SqlStatement.StatementLocus(<br>
                                Locus.peek().execution,<br>
                                "SqlTupleReader.readTuples " +
partialTargets,<br>
                                message,<br>
                                SqlStatementEvent.Purpose.TUPLES, 0),<br>
                            -1, -1);<br>
                        (...)<br>
<br>
So, at that point I should get the topLevel's member but I got an
exception from Locus.peek().execution. And it's a little hard to
understand what's the problem.<br>
<br>
Thanks in advance.<br>
<br>
Regards.<br>
<br>
-- <br>
<pre class="moz-signature" cols="72">Kleyson Rios
Gestor de TI
Coordenador de BI / Banco de Dados
Gerência de Tecnologia da Informação
Secretaria de Estado da Saúde de Goiás
(62) 3201-3707

Se não pode vencer pelo talento, vença pelo esforço. (Dave Weinbaum) </pre>
<br>
Em 13/6/2012 15:56, Luc Boudreau escreveu:
<blockquote
 cite="mid:CAKTEAx_8g0ALOMV3NaR9qycWiO05v-4ameuNMd0kWwwRdVVeUg@mail.gmail.com"
 type="cite">
  <meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
Try this:<br>
  <br>
  <span>               return Locus.execute(</span><br>
  <span>                mondrianConnection,</span><br>
  <span>                "Description",</span><br>
  <span>                new Locus.Action&lt;Void&gt;() {</span><br>
  <span>                    public Void execute()</span><br>
  <span>                    {</span><br>
  <span>                        // Do anything here.<br>
                        return null;<br>
  </span><span>                    }</span><br>
  <span>                });</span><br>
  <br>
... where MondrianConnection is a RolapConnection object. May I ask why
you need to use the private API?<br>
  <br>
Luc<br>
  <br>
  <br>
  <div>On Wed, Jun 13, 2012 at 2:52 PM, Kleyson Rios <span>&lt;<a
 moz-do-not-send="true" href="mailto:kleysonrios@saude.go.gov.br">kleysonrios@saude.go.gov.br</a>&gt;</span>
wrote:<br>
  <blockquote>I am trying to understand some things and in the<br>
mondrian.rolap.SqlTupleReader we have:<br>
    <br>
protected void prepareTuples(<br>
        DataSource dataSource,<br>
        TupleList partialResult,<br>
        List&lt;List&lt;RolapMember&gt;&gt; newPartialResult)<br>
    {<br>
                (...)<br>
    <br>
                stmt = RolapUtil.executeQuery(<br>
                    dataSource, sql, types, maxRows, 0,<br>
                    new SqlStatement.StatementLocus(<br>
                        Locus.peek().execution,<br>
                        "SqlTupleReader.readTuples " + partialTargets,<br>
                        message,<br>
                        SqlStatementEvent.Purpose.TUPLES, 0),<br>
                    -1, -1);<br>
    <br>
                (...)<br>
}<br>
    <br>
And when I run stmt I got the following exception at<br>
Locus.peek().execution: "throw new EmptyStackException();"<br>
    <br>
I would expect get a result from the sql.<br>
    <br>
Parameters:<br>
dataSource: org.apache.commons.dbcp.PoolingDataSource@1def85<br>
    <br>
sql: select "CUSTOMER_W_TER"."TERRITORY" as "c0" from "CUSTOMER_W_TER"<br>
as "CUSTOMER_W_TER" group by "CUSTOMER_W_TER"."TERRITORY" order by CASE<br>
WHEN "CUSTOMER_W_TER"."TERRITORY" IS NULL THEN 1 ELSE 0 END,<br>
"CUSTOMER_W_TER"."TERRITORY" ASC<br>
    <br>
types: [null]<br>
    <br>
maxRows: 0<br>
    <br>
    <br>
Any idea ?<br>
    <br>
Regards.<br>
    <br>
--<br>
Kleyson Rios<br>
Gestor de TI<br>
Coordenador de BI / Banco de Dados<br>
Gerência de Tecnologia da Informação<br>
Secretaria de Estado da Saúde de Goiás<br>
    <a moz-do-not-send="true" href="tel:%2862%29%203201-3707">(62)
3201-3707</a><br>
    <br>
Se não pode vencer pelo talento, vença pelo esforço. (Dave Weinbaum)<br>
    <br>
_______________________________________________<br>
Mondrian mailing list<br>
    <a moz-do-not-send="true" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
    <a moz-do-not-send="true"
 href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Mondrian mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a>
<a class="moz-txt-link-freetext" href="http://lists.pentaho.org/mailman/listinfo/mondrian">http://lists.pentaho.org/mailman/listinfo/mondrian</a>
  </pre>
</blockquote>
</body>
</html>