Re: Seam Wicket integration and conversation scope
Nice and interesting. This could be a valid alternative to simulate the Seam conversation-scoped persistent context. Although doing so the presentation layer is too tied to persistent session handling aspect. I think this could be really useful in a simple scenario with few pages, but in complex use causes (and integrating other frameworks like jbpm that need to share the same hibernate session) it will drive in a hell. Thank you. // Paolo On Sun, Mar 23, 2008 at 2:25 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: conversation scope is slightly different, for long running hibernate sessions it is an equivalent of doing: class conversationpage extends webpage { private org.hibernate.Session session; public conversationpage(Session session) { this.session=session; } protected Session getSession() { if (!session.isconnected()) { session.reconnect(); } return session; } protected void ondetach() { session.disconnect(); } } so in this case the conversation would be propogated so: setresponsepage(new edituserstep2page(getsession(), usermodel)); -igor On Sat, Mar 22, 2008 at 6:13 PM, brian.diekelman [EMAIL PROTECTED] wrote: I have only read up on Seam a few times, so help me out where I'm incorrect... As far as I can tell Seam uses the conversation scope as a step between request scope and session scope to persist values across a couple of requests, for instance a user creation wizard, etc. I don't know what integration they've enabled or how it works, but passing an object between requests is simple and straight forward in wicket. Say that you want to pass a user object (or any other combination of objects) from one page to another when the user clicks a link: public class SimplePage extends WebPage { public SimplePage(final User user) { add(new Link(link) { public void onClick() { setResponsePage(new SomeOtherPage(user)); } } } } You would pass it directly by reference. Like I said, I don't know how Seam is integrating, but when you're using Wicket you don't really have a need for something like a conversation scope. You can use whatever granularity you'd like to pass objects between pages, not necessarily bound to any particular scope. Please let me know if I'm just completely missing your point here. -- View this message in context: http://www.nabble.com/Seam-Wicket-integration-and-conversation-scope-tp16228793p16230158.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Seam Wicket integration and conversation scope
i didnt say to do that. i simply said that this is what persistent context means...and that session object in my example is the hibernate session. -igor On Sun, Mar 23, 2008 at 1:21 AM, Paolo Di Tommaso [EMAIL PROTECTED] wrote: Nice and interesting. This could be a valid alternative to simulate the Seam conversation-scoped persistent context. Although doing so the presentation layer is too tied to persistent session handling aspect. I think this could be really useful in a simple scenario with few pages, but in complex use causes (and integrating other frameworks like jbpm that need to share the same hibernate session) it will drive in a hell. Thank you. // Paolo On Sun, Mar 23, 2008 at 2:25 AM, Igor Vaynberg [EMAIL PROTECTED] wrote: conversation scope is slightly different, for long running hibernate sessions it is an equivalent of doing: class conversationpage extends webpage { private org.hibernate.Session session; public conversationpage(Session session) { this.session=session; } protected Session getSession() { if (!session.isconnected()) { session.reconnect(); } return session; } protected void ondetach() { session.disconnect(); } } so in this case the conversation would be propogated so: setresponsepage(new edituserstep2page(getsession(), usermodel)); -igor On Sat, Mar 22, 2008 at 6:13 PM, brian.diekelman [EMAIL PROTECTED] wrote: I have only read up on Seam a few times, so help me out where I'm incorrect... As far as I can tell Seam uses the conversation scope as a step between request scope and session scope to persist values across a couple of requests, for instance a user creation wizard, etc. I don't know what integration they've enabled or how it works, but passing an object between requests is simple and straight forward in wicket. Say that you want to pass a user object (or any other combination of objects) from one page to another when the user clicks a link: public class SimplePage extends WebPage { public SimplePage(final User user) { add(new Link(link) { public void onClick() { setResponsePage(new SomeOtherPage(user)); } } } } You would pass it directly by reference. Like I said, I don't know how Seam is integrating, but when you're using Wicket you don't really have a need for something like a conversation scope. You can use whatever granularity you'd like to pass objects between pages, not necessarily bound to any particular scope. Please let me know if I'm just completely missing your point here. -- View this message in context: http://www.nabble.com/Seam-Wicket-integration-and-conversation-scope-tp16228793p16230158.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Seam Wicket integration and conversation scope
I'm playing with the latest Seam release (2.1.0.A1) containing a really interesting integration of Apache Wicket. The current implementation appear to be really promising and I hope it will improved in next release. One of the most interesting feature already implemented is the conversation scope that enables conversation-scoped persistent context. I've noticed that the conversation between different wicket pages is maintained only navigating by a form submit action BUT it doesn't when moving between pages using other components i.e. Link, AjaxLink, Button, AjaxBehavior .. and so on. This makes it useless, in particular with Ajax interactions where it is expected to have the maximum benefits (no more LazyInitializationException .. ). Is this a know issue? It is planned in next release to maintained the conversation between Wicket pages navigating by Link and AjaxBehavior also? Thank you, // Paolo
Re: Seam Wicket integration and conversation scope
I have only read up on Seam a few times, so help me out where I'm incorrect... As far as I can tell Seam uses the conversation scope as a step between request scope and session scope to persist values across a couple of requests, for instance a user creation wizard, etc. I don't know what integration they've enabled or how it works, but passing an object between requests is simple and straight forward in wicket. Say that you want to pass a user object (or any other combination of objects) from one page to another when the user clicks a link: public class SimplePage extends WebPage { public SimplePage(final User user) { add(new Link(link) { public void onClick() { setResponsePage(new SomeOtherPage(user)); } } } } You would pass it directly by reference. Like I said, I don't know how Seam is integrating, but when you're using Wicket you don't really have a need for something like a conversation scope. You can use whatever granularity you'd like to pass objects between pages, not necessarily bound to any particular scope. Please let me know if I'm just completely missing your point here. -- View this message in context: http://www.nabble.com/Seam-Wicket-integration-and-conversation-scope-tp16228793p16230158.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Seam Wicket integration and conversation scope
conversation scope is slightly different, for long running hibernate sessions it is an equivalent of doing: class conversationpage extends webpage { private org.hibernate.Session session; public conversationpage(Session session) { this.session=session; } protected Session getSession() { if (!session.isconnected()) { session.reconnect(); } return session; } protected void ondetach() { session.disconnect(); } } so in this case the conversation would be propogated so: setresponsepage(new edituserstep2page(getsession(), usermodel)); -igor On Sat, Mar 22, 2008 at 6:13 PM, brian.diekelman [EMAIL PROTECTED] wrote: I have only read up on Seam a few times, so help me out where I'm incorrect... As far as I can tell Seam uses the conversation scope as a step between request scope and session scope to persist values across a couple of requests, for instance a user creation wizard, etc. I don't know what integration they've enabled or how it works, but passing an object between requests is simple and straight forward in wicket. Say that you want to pass a user object (or any other combination of objects) from one page to another when the user clicks a link: public class SimplePage extends WebPage { public SimplePage(final User user) { add(new Link(link) { public void onClick() { setResponsePage(new SomeOtherPage(user)); } } } } You would pass it directly by reference. Like I said, I don't know how Seam is integrating, but when you're using Wicket you don't really have a need for something like a conversation scope. You can use whatever granularity you'd like to pass objects between pages, not necessarily bound to any particular scope. Please let me know if I'm just completely missing your point here. -- View this message in context: http://www.nabble.com/Seam-Wicket-integration-and-conversation-scope-tp16228793p16230158.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]