in ejb3? i thought these were stateful beans stored in user's session? maybe im wrong.

if they are not, then yes it would not be safe to store them in session. instead a locator proxy should be used like the one in wicket-spring.

-Igor


On 3/30/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
EJB session beans are unrelated to servlet sessions. It's probably not
wise to store such reference objects in the servlet session as - if
they would be clustered - they might point to the wrong address.

Eelco


On 3/30/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> the only concern here is that you do not want to put things into session
> that you dont want serialized, etc. since this is a session bean that means
> it is in session already anyways, so you should be ok passing it around in
> wicket.
>
>
> -Igor
>
>
> On 3/30/06, Vincent Jenks < [EMAIL PROTECTED]> wrote:
> >
> > Well...on page1 it would create the ShoppingCart stub from JNDI....I'd
> pass it to page2 as a param....page2 would modify it....and pass it to
> page3....and so on.
> >
> > It's a single, stateful session bean.
> >
> >
> >
> > On 3/30/06, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
> > >
> > > depends on what the stub references. if you already have it in session
> somewhere then its ok.
> > >
> > >
> > > -Igor
> > >
> > >
> > >
> > > On 3/30/06, Vincent Jenks < [EMAIL PROTECTED]> wrote:
> > > >
> > > > OK, I'll check into it, thanks.  Meanwhile, if I *did* want to...I
> could pass the cart stub around in the constructors, couldn't I?  Or, is
> this somehow not safe?
> > > >
> > > > I'm thinking that might be the quickest, easiest approach for now.  I
> only need it for a few pages.
> > > >
> > > >
> > > >
> > > > On 3/30/06, Igor Vaynberg < [EMAIL PROTECTED] > wrote:
> > > > >
> > > > > i didnt say introduce spring as a dependency.
> > > > > i said look at how wicket-spring injects special proxies into wicket
> components that you can safely store in session, etc
> > > > > it will take very little tweaking to make it work for ejb3.
> > > > >
> > > > > look at the Spring page on the wiki to see why the proxies exist and
> how they work.
> > > > >
> > > > > wicket-spring provides an elegant solution, but only a tiny portion
> of it is spring related.
> > > > >
> > > > >
> > > > > -Igor
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > On 3/30/06, Vincent Jenks <[EMAIL PROTECTED] > wrote:
> > > > > >
> > > > > > I'd rather not introduce spring as yet another dependency on this
> project...especially because I know very little about it and don't have the
> time to tinker w/ it for this project.
> > > > > >
> > > > > > What about passing the ShoppingCart EJB stub around in my page
> constructors instead of using a getter/setter in my custom UserSession
> class?  Wouldn't that be safe?
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 3/29/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > you can inject the proxy into any component
> > > > > > >
> > > > > > > look at wicket-spring project
> > > > > > >
> > > > > > > you can create a IFieldValueFactory that injects a proxy for
> your stateful bean.
> > > > > > >
> > > > > > >
> > > > > > > -Igor
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 3/29/06, Vincent Jenks < [EMAIL PROTECTED]> wrote:
> > > > > > > >
> > > > > > > > I'm sitting here, pondering, and getting fatter.  I'm building
> a storefront app w/ a simple shopping cart for which I'm thinking of using a
> Stateful session bean (EJB 3.0).
> > > > > > > >
> > > > > > > > It looks like, no matter how I look at it, I'll have to keep
> the SFSB stub in-session throughout its use in the application...and I'm not
> sure of a real elegant way of doing that.  So, I was just hoping someone
> here could provide some insight.
> > > > > > > >
> > > > > > > > In Wicket, I've already got a class called UserSession which I
> use to pass around an User so I can test whether or not a page is accessible
> by certain user groups.  I decided, to keep it simple, that I'd add a getter
> & setter for my ShoppingCart stub in the same class so it could be passed
> around in-session w/ the User, since each shopper will have an User
> automatically created for them before checking out and paying.
> > > > > > > >
> > > > > > > > The problem w/ all this SFSB business is; it violates my
> design because I have to make my web tier talk directly to my session bean
> in order to keep track of its state.  For everything else I've been using a
> handful of proxy classes where I could place calls to my session beans and
> other business logic.
> > > > > > > >
> > > > > > > > It looks a little like this:
> > > > > > > >
> > > > > > > > Wicket->ProxyClass->SessionBean->Database
> > > > > > > >
> > > > > > > > So, now I'll have to keep track of the ShoppingCart stub class
> in Wicket, pass the ShoppingCart and the users' chosen form values into the
> Proxy, perform business logic, and then return a ShoppingCart which I'll
> have to place *back* into the UserSession.setCart() method to continue to
> keep track of the state of the users' carts.
> > > > > > > >
> > > > > > > > This is kinda nasty, is there an easier (or just more elegant)
> way to do this?
> > > > > > > >
> > > > > > > > Thanks all!
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to