You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by David Sean Taylor <da...@bluesunrise.com> on 2006/02/06 23:02:16 UTC

wrappering of servlet request

Im debugging some multithreaded aggregation bits, and came across 
something that looks suspect.

In ServletPortletInvoker, we have a triple unraveler of the request:

         // gather all required data from request and response
         ServletRequest servletRequest = 
((HttpServletRequestWrapper)((HttpServletRequestWrapper)((HttpServletRequestWrapper)portletRequest).getRequest()).getRequest()).getRequest();

and then in JetspeedContainerServlet:

// inject the current request into the renderRequest handler 
((o.a.j.engine.servlet.ServletRequestImpl)
 
((HttpServletRequestWrapper)((HttpServletRequestWrapper)renderRequest).getRequest()).setRequest(request);

It seem to me that we need to abstract this code into something a little 
more manageable and extensible. Im trying to write my own portlet 
invoker, and because of this assumed wrappering, things are not 
unraveling as aspected. It appears that this assumed wrappering needs to 
be better abstracted and encapsulated, instead of having wrappering 
assumptions across components. If no one objects Im going to start 
looking into doing just that

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Re: OJB + Spring transactions broken

Posted by David Sean Taylor <da...@bluesunrise.com>.
David Sean Taylor wrote:
> I tried writing a unit test to test OJB + Spring transactions.
> To my suprise, transactions are not starting.
> 
> In fact, Im seeing some surprising results in mysql.log
> (yes Im using InnoDB), note no transactions, and the forced autocommit
> 
reproduced on Oracle

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


OJB + Spring transactions broken

Posted by David Sean Taylor <da...@bluesunrise.com>.
I tried writing a unit test to test OJB + Spring transactions.
To my suprise, transactions are not starting.

In fact, Im seeing some surprising results in mysql.log
(yes Im using InnoDB), note no transactions, and the forced autocommit

118 Query       SET autocommit=1
117 Prepare     [1] INSERT INTO FOLDER...
117 Execute     [1] INSERT INTO FOLDER... 		
117 Query       SET autocommit=1


It appears that OJB repeatedly sets autocommit=1
and
it never starts any transactions

Here is my unit test, which tests out a new 'fake' API addPage to the 
PageManager. This API is temporary to test transactional behavior:

public void testTx() throws Exception
     {
         Folder root = pageManager.newFolder("/");
         pageManager.updateFolder(root);
         Page[] pages = new Page[3];
         pages[0] = pageManager.newPage("/test1.psml");
         pages[1] = pageManager.newPage("/test2.psml");
         pages[2] = pageManager.newPage("/test3.psml");
         try
         {
             pageManager.addPages(pages);
         }

In addPages, I try to force a rollback:

     public int addPages(Page[] pages)
     throws JetspeedException
     {
         System.out.println("Adding first page");
         this.updatePage(pages[0]);
         System.out.println("Adding second page");
         this.updatePage(pages[1]);
         System.out.println("About to throw ex");
         throw new JetspeedException("Its gonna blow captain!");
     }

Finally, add pages is enabled for a Spring tx:

                 <prop 
key="addPages*">PROPAGATION_REQUIRED,-org.apache.jetspeed.exception.JetspeedException</prop> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org