You can either implement your transaction handling in your business objects that are simply called from wicket or if you really want transactional code in your pages you can subclass WebRequestCycle and override the methods:

onRuntimeException() - rollback transaction
onEndRequest() - commit transaction if necessary

This would look something like this in your Application class:


        protected IRequestCycleFactory getDefaultRequestCycleFactory()
        {
                return new IRequestCycleFactory()
                {
public RequestCycle newRequestCycle(Session session, Request request, Response response)
                        {
return new WebRequestCycle((WebSession) session, (WebRequest) request, (WebResponse) response)
                                {
                                        ...                             
                                }
                        }
        }

John.



On 11 May 2006, at 08:47, Ralf Ebert wrote:

Hi,

I'm using a RequestCycleProcessor to provide a threadlocal-based
transaction to my application. I use something like:

        protected IRequestCycleProcessor newRequestCycleProcessor() {
                return new DefaultWebRequestCycleProcessor() {
                        
                        public void respond(RequestCycle requestCycle) {
                                System.out.println("Respond =>");
                                //prepare tx
                                super.respond(requestCycle);
                                //close tx
                                System.out.println("Respond <=");
                        }
                        
                };
                
        }

With a page with form action, I get something like this:

onSubmit =>
onSubmit <=
Respond =>
Respond <=

This is not what I intended to do, because I need to provide one
transaction around every request to a WebPage (the only exception are
resources like images or css). So the request cycle processor doesn't
seem to be right. Servlet filter is too complicated as well, because I
want wicket exception handling and wraping requests to WebPages
only... Anything I can do about this?

Regards,
Ralf


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to