Query timeout/cancel

Axiome
2008-02-29
2013-04-29
  • Axiome
    Axiome
    2008-02-29

    Hi to everybody,
    I'd like to stop a query that remains too much time in execution.
    Starting from Mondrian 2.1.1 version, there is a method "cancel" in class mondrian.olap.Query that issues a cancel request on this Query object stopping the execution, but in JPivot I don't find any way to use it (any buttons?).
    Does anyone know how I can use it in JPivot interface?
    If a way doesn't exist, how can I add this function in JPivot?

    Thanks in advance

     
    • Julian Hyde
      Julian Hyde
      2008-02-29

      I think it's difficult to add that functionality because when you make a request in jpivot   it requests a full page refresh (i.e. it's not ajax) and you can't cancel a pending http request.

      By the way, please don't cross-post to multiple jpivot forums.

      Julian

       
      • Alexander
        Alexander
        2008-03-01

        What are the advances on an AJAX version of JPivot?

        From my point of view there should be a first approach where the Pivot page is segmented in regions and evry click just refreshes the region related... so the navegator pops, the table drill down/up refreshes without moving the page scroll, chart options popup, ETC....

        I believe that there are 2 frameworks that can help to do this very quickly.. AjaxAnywhere or RichFaces (this implies using JSF) both are filter based, so JPivot can work the same way... no changes to the architecture...

        And... Optionally CANCEL a query....

         
        • Julian Hyde
          Julian Hyde
          2008-03-01

          No one is working on an AJAX version of jpivot as far as I know. Everyone says they want one, yet no one has the time to build one. Reminds me of the story of the Little Red Hen: http://www.elliottsamazing.com/lrh.html

          Two guys from Pentaho recently started a project to develop an AJAX viewer based on olap4j and GWT. The project is called halogen: http://code.google.com/p/halogen/

          Julian

           
          • Andreas Voss
            Andreas Voss
            2008-03-02

            One problem with ajax is that neither JPivot nor Mondrian are multithreaded. So one must ensure for example, that a navigation like 'drill down' must not occour while another query is still running.

             
            • Julian Hyde
              Julian Hyde
              2008-03-03

              > One problem with ajax is that neither JPivot nor Mondrian are multithreaded.

              Not true. Mondrian is multi-threaded.

              There are limitations, such as that you should not run two statements in the same session at the same time, and you should not modify a parse tree while another statement is executing a query based on that parse tree. And doubtless there are bugs.

              Julian

               
    • superbeppe77
      superbeppe77
      2008-03-02

      Hi,

      I understand the matter and I'm agree with solution to use ajax request.

      I'm using jpivot too and in the server side I get OlapModelProxy to dynamically set new mdx query.
      But I can't find how retrieve a suitable object over call cancel().

      So please can you point me on right direction providing a suggestion? 

      Thanks in advance and best regards

       
      • Andreas Voss
        Andreas Voss
        2008-03-02

        The OlapModelProxy is part of a decorator chain, that decorate the underlying MondrianOlapModel with caches and other services.

        If you want to cleanly add a new feature to JPivot, you should introduce a new Extension to the OlapModel, lets say "CancelQueryExtension". Next implement the extension for Mondrian, e.g. "MondrianCancelQueryExtension" and add it to the config.xml. Now the UI can check whether or not the "CancelQueryExtension" is supported (e.g. for Mondrian it is supported, for XML/A its not) and behave accordingly. You will probably not have to touch any existing code except maybe MondrianModel to actually perform the cancelling.

        Look at the "SwapAxes" extension for a simple example of an extension.

        Andreas

         
        • superbeppe77
          superbeppe77
          2008-03-02

          Thank you very much for rapid and useful response.