5 Replies Latest reply on Nov 8, 2007 1:01 AM by claprun

    WSRP and managed transactions

      This is for version 2.6.2 of the portal.

      I have a question regarding managed transactions. We have developed a portlet that is using hibernate and it is managing its own transactions. If this is deployed and viewed locally on a JBoss portal instance everything works ok.

      Now the problem. When this portlet is deployed on a JBoss portal and exposed through WSRP to another JBoss portal instance there is an error message that comes out mentioning and you cannot call commit in a managed transaction. Something tells me that the WSRP request is processed within a managed transaction and that propagates to the portlet. Is it possible to disable that so portlets that manage their own transactions run properly?

      This is the SQLException:
      java.sql.SQLException: You cannot commit during a managed transaction!

      If necessary I can put the whole stack trace in here.

      Thanks,
      Florian

        • 1. Re: WSRP and managed transactions

          I kind of found the answer to this by myself. There is a TransactionFilter class that is setup in the web.xml for the WSRP service archive. This class will start a transaction. The comment in the class is that the WSRP runtime needs transactions so it creates them.

          I think there is a problem with consistency here as far as I am concerned at least. When a portlet executes normally in the container it is not wrapped in a transaction. If the same portlet executes as part of a WSRP request then it will be wrapped in a transaction.

          Is it possible to introduce a standard here somehow? I know that for example if using hibernate you might be able to get away with this by changing the transaction manager but I think there has to be a better way.

          Florian

          • 2. Re: WSRP and managed transactions
            claprun

            Will look into it. Thanks for the report.

            • 3. Re: WSRP and managed transactions
              claprun

              Could you provide the complete stack trace, please?

              • 4. Re: WSRP and managed transactions

                Will do as soon as I get back in the office tomorrow.

                • 5. Re: WSRP and managed transactions
                  claprun

                  I opened a JIRA task for it: http://jira.jboss.com/jira/browse/JBPORTAL-1786 and I think that this is now fixed in subversion. If you are able to build Portal from subversion, I would appreciate if you could take it for a spin and let me know if it fixes your issue. Thanks again for the report.