this sounds right to me except for the case where a page is referencing "static" resources that are actually stored in hibernate somehow. i wonder if it isn't best to just pass a flag to being/end request that indicates what kind of request is beginning/ending. that would be a bit more flexible for the odd case like a static resource that needs hibernate info and would still allow the kind of efficient hibernate behavior you want. it seems more complete somehow. thoughts?
Eelco Hillenius wrote:
No, I am talking about RequestCycle here. That has nothing to do with any component. The request cycle is created for every request, and has onBeginRequest and onEndRequest called. If you look at the cdapp example, it has a custom RequestCycle implementation that opens a Hibernate session at the start of the request, and closes it at the end. This works great, but I don't want it to happen for any static resource. And as there is nothing you would want to do with static resources that you can't using a filter, my proposal is to only call these methods for 'dynamic'/ Wicket invocations.
Eelco
Gili wrote:
So are we saying that onBeginRequest(), onEndRequest() does not belong in Component but rather in some subclass like Page?
I don't necessarily see the harm in leaving the current design (where it is called regardless of the type of the underlying Component). On the other hand, if you want to narrow the usage so it only applies to Page, I think I am ok with that.
Gili
Eelco Hillenius wrote:
But the thing is, that it is also done for images etc. And if you really want to trap all, just use a servlet filter (cause that's what they're for anyway).
Eelco
Gili wrote:
I'm -1 on this. Regardless of whether the page is static or dynamic, a request begins and ends. Who knows, developers might make use of this for static pages in the future. A page-hit counter comes to mind <shrug>
Gili
Eelco Hillenius wrote:
Currently, these onBeginRequest/onEndRequest are also called when pages are static resources etc. I think this is wrong, as the typical usage of these overridable methods (which are empty by default) is to open/close Hibernate sessions etc.
Agreed to fix this?
Eelco
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
