1 2 Previous Next 22 Replies Latest reply on Jan 23, 2013 3:49 PM by rhauch Go to original post
      • 15. Re: Getting a sequencer to engage?
        rhauch

        That additional save is not required, and likely is a bug. Please log a bug in our JIRA. I was trying to give you a workaround for the issue, but also to show you a more efficient way of updating the file (in this particular case).

        • 16. Re: Getting a sequencer to engage?
          ajs6f

          Thank you-- I will log an issue. I appreciate the help, and the code is shorter and clearer for it.

           

          I am thinking now that the only two steps left to me on the sequencer problem are to recompile ModeShape with extra logging (as suggested earlier) and/or to write a blocking call to the sequencer into the JAXRS code, so that it is forced to act. I tested that and it seems to work fine, although it doesn't take any advantage of the elegant asynchronous sequencer framework, one of (to my inexpert eye) ModeShape's biggest attractions. Before I start that work, is there anything else about our code that seems odd to you or suggests any reason why the sequencers aren't executing?

           

          ---

          UPDATE

           

          Holy cow!

           

          I added Infinispan configuration (a very simple FileCacheStore with PESSIMISTIC locking) and it works! The sequencing magically turned on!

           

          I'm very happy to see it, but even more confused. From what you've said (if I've understood correctly) the Infinispan configuration should have no effect at all on this functionality. Is this a bug? Shall I file an issue for it?

           

          Thanks so much for all the help. I'm going to go back to enjoying ModeShape.

          • 17. Re: Getting a sequencer to engage?
            rhauch

            I am thinking now that the only two steps left to me on the sequencer problem are to recompile ModeShape with extra logging (as suggested earlier) and/or to write a blocking call to the sequencer into the JAXRS code, so that it is forced to act. I tested that and it seems to work fine, although it doesn't take any advantage of the elegant asynchronous sequencer framework, one of (to my inexpert eye) ModeShape's biggest attractions. Before I start that work, is there anything else about our code that seems odd to you or suggests any reason why the sequencers aren't executing?

            Some applications will need that sequenced output before returning the response, which makes the asynchronous sequencing more difficult to use because the application needs to block for the sequence to be generated and saved.

             

            The proper way to block for the sequencing operation to be completed is to use the observation feature. See this section of our documentation.

             

            There is also a proposed feature that will allow your session to directly invoke the sequencer, and to have the generated output stay in the Session's transient state (which would need to be saved if it were to be kept). However, this is not yet completed, and we're not sure exactly how it might work if the sequencer is also configured to asynchronously process the content. Feedback (as comments on the issue) would be appreciated.

            • 18. Re: Getting a sequencer to engage?
              ajs6f

              I see your points about asynchrony. For my immediate example, asynchrony is actually fine, but if we have to engage in a synchronous manner, we'll be sure to use the feature you pointed to. (Looks like it's essentially the use of JCR Observation with specific event types?)

               

              For transactional purposes, I think we might very well want to be able to invoke sequencing inside the same Session-based scope as the mutating request. Unfortunately, I can't say much more right now because our work is at such an early stage. Of course, if the sequencing is going on asynchronously instead, that raises the specter of a transaction distributed across Session scopes. I'm no JCR expert, but it's not clear to me that appropriate abstractions exist in the JCR semantics to describe such things. Then again, sequencing is not a JCR-defined activity.

               

              Thanks for all the help! We're now able to move on and experiment further. As requested, I'll be filing an issue about the peculiarity with "extra saves". Would you like me to file an issue about the appearance that sequencing won't engage without an Infinispan config (perhaps of some particular character) in place?

              • 19. Re: Getting a sequencer to engage?
                rhauch

                I see your points about asynchrony. For my immediate example, asynchrony is actually fine, but if we have to engage in a synchronous manner, we'll be sure to use the feature you pointed to. (Looks like it's essentially the use of JCR Observation with specific event types?)

                That's essentially all the sequencing events are.

                 

                 

                For transactional purposes, I think we might very well want to be able to invoke sequencing inside the same Session-based scope as the mutating request.

                That is perhaps the most important benefit of being able to invoke a sequencer via the session.

                 

                 

                Of course, if the sequencing is going on asynchronously instead, that raises the specter of a transaction distributed across Session scopes. I'm no JCR expert, but it's not clear to me that appropriate abstractions exist in the JCR semantics to describe such things. Then again, sequencing is not a JCR-defined activity.

                JCR itself has no notion of sequencing. As currently implemented the asynchronous sequencing operations will be executed only after the session that adds sequenceable content is saved (and committed, if in a user transaction). But each sequencer operation will produce its output in a single transaction as well -- so the output will either be stored or not (the latter only when there is an error in the sequencing).

                 

                 

                Thanks for all the help! We're now able to move on and experiment further. As requested, I'll be filing an issue about the peculiarity with "extra saves". Would you like me to file an issue about the appearance that sequencing won't engage without an Infinispan config (perhaps of some particular character) in place?

                 

                Yes, please log that issue and note in it that it is for the default Infinispan configurations only (which doesn't but should have PESSIMISTIC locking), and that the workaround is to simply define your own Infinispan configuration (whether or not it persists content using a cache store). Thanks!

                • 20. Re: Getting a sequencer to engage?
                  rhauch

                  I cloned your repository and tried to build it with "mvn clean install", and it worked successfully as-is. I also looked at your README file, and the initial 'curl' call doesn't work.

                   

                  Can you please provide detailed instructions on how to run/test/use your web application? I'd like to figure out why the sequencers seem to work only after changing the locking to PESSIMISTIC.

                   

                  Thanks

                  • 21. Re: Getting a sequencer to engage?
                    ajs6f

                    The easiest way to run it is via "mvn lean jetty:run".

                     

                    That README is a bit out of date. I'll correct it right now.

                     

                    There are no detailed instructions possible because this application is only a few days old. It's part of a larger suite of experiments towards finding a new technical platform for Fedora Commons (http://fedora-commons.org/). ModeShape is one contender.

                     

                    ---

                    UPDATE

                     

                    I've just updated the README with that info. Thanks for taking an interest!

                    • 22. Re: Getting a sequencer to engage?
                      rhauch

                      Understood. But if I run "mvn clean jetty:run", then I still need to interact with the web app. So I guess all I need are the 'curl' commands to upload a file that will be sequenced, and then commands to access the sequenced information.

                      1 2 Previous Next