4 Replies Latest reply on Jan 19, 2012 1:16 PM by marnold

    MODE-1123 ModeShape should participate in local JTA transactions

    marnold

      Hi,

       

      I am developing a proof of concept using JBoss AS 5.1 and ModeShape 2.7.0_Final, and have hit this limitation of ModeShape: MODE-1123

       

      I get: java.sql.SQLException: You cannot commit during a managed transaction! when I try to login to a JCR repository.

       

      Is there some work around I can use? Some sort of MODE-1123 Lite?  The notes associated with issue seem to suggest there might be one, but I don' t really understand them...

       

      I only want to read from the repository within EJB, never to write to it.  I login and read from the repository in a @PostConstruct method of an stateless session bean.  I have an XA datasource. I would prefer to use container managed transactions, but can use bean managed for this particular bean. 

       

      Thanks in advance for any help.

        • 1. Re: MODE-1123 ModeShape should participate in local JTA transactions
          rhauch

          We tried a couple of changes that allowed "JTA-lite" support to allow ModeShape to use a JTA-enabled data source. But this resulted in some (hidden) consistency problems with the data, so we abandoned the changes.

           

          I really do understand the difficulty and limitations we've placed on how ModeShape can be used. In all honesty we made some earlier architectual decisions that make it extremely difficult to add support for participating in container-managed transactions. As I mention in the comments on MODE-1123, we've learned from our mistakes and know how we're going to support this feature with 3.0.

           

          I apologize for the inconvenience!

          • 2. Re: MODE-1123 ModeShape should participate in local JTA transactions
            marnold

            Thanks Randall for being so forthright. You've saved me a lot of time by not exploring a dead end.

             

            I'm glad you understand my problem.  I often work on proof of concepts, technical architectures... etc, and a lot of this involves making different components - sometimes from different vendors - work together. It's frustrating when my grand designs are thwarted when they don't.  I often wish authors of software tools would concentrate more on flexibility in the ways their projects can be used, rather than features or performance (for example).

             

            That wasn't meant as a criticism, just an observation.  Before anything else I appreciate good documentation, and I have been very impressed by the quality of documentation for ModeShape.  Good documentation makes the difference between being able to pick up a tool and start using it, and spending hours searching the web for tidbits of info.  The latter is too often the case at jboss.org, but ModeShape is excellent!

             

            Cheers,

            Malcolm.

            • 3. Re: MODE-1123 ModeShape should participate in local JTA transactions
              rhauch

              ...I often wish authors of software tools would concentrate more on flexibility in the ways their projects can be used, rather than features or performance (for example).

               

              User feedback is critical, so please keep that coming. We also welcome contributors, even if that's just helping with documentation or implementing minor features. If you (or anyone else) is interested in contributing, please ask.

               

              ... Before anything else I appreciate good documentation, and I have been very impressed by the quality of documentation for ModeShape.  Good documentation makes the difference between being able to pick up a tool and start using it, and spending hours searching the web for tidbits of info.  The latter is too often the case at jboss.org, but ModeShape is excellent!

              Thanks!

              • 4. Re: MODE-1123 ModeShape should participate in local JTA transactions
                marnold

                Just in case anyone stumbles across this thread with the same problem....

                 

                Work around I used was to load what I need from the JCR repository in an MBean, then in the SLSB I call MBean operations to get the objects I need.  So pretty ugly - and don't know how to get the MBeanServerConnection without doing something JBoss specific - but works.