-
1. Re: Seam-wicket transaction and lifecycle
cpopetz Jan 22, 2009 5:17 PM (in response to garidan.daniele.gariboldi.gmail.com)It is true that Seam/Wicket doesn't create transactions for you. It is however a lot easier to do it yourself in Wicket than in JSF, because you're always operating in java. So for instance, you could abstract into a base WebPage class something like:
protected void onBeforeRender() { org.jboss.seam.transaction.Transaction.begin(); super.onBeforeRender(); }
and similarly with onAfterRenderChildren.
I think Seam/Wicket should do something like this by default, but I'll need to ponder exactly how. So I've opened JBSEAM-3909
Your suggestions are also welcome.
-
2. Re: Seam-wicket transaction and lifecycle
garidan.daniele.gariboldi.gmail.com Jan 22, 2009 7:04 PM (in response to garidan.daniele.gariboldi.gmail.com)I think I'll not miss seam transaction mananagement, but I think it should be documented this difference between seam-jsf and seam-wicket.
I like your suggestion on onBeforeRender and onAfterRenderChildren.
I read once Gavin saying it's important to use even a read-only transaction in the render phase (of JSF, but applies to wicket too and regards lazy loading in hibernate): he said it helps the db for performance if I remember it right.
For my business layer, i prefer to have control on my transactions and it's along wicket philosophy to control behaviour in java code, without any magic happening behind your code.Thanks for the ready answer, I'll contribute as soon as I can.