If you have a model like this:

class LoadableModel
{
private EjbBean bean;
}

then this could be a problem
because it should be something like this:

class LoadableModel
{
private EjbBeanProxy bean;
}

and proxy something like this:

class EjbBeanProxy
{
 transient EjbBean bean;
 String jndiname

 if(bean == null) jndiLookup.lookup(jndiname)
}

johan


On 12/28/06, Korbinian Bachl <[EMAIL PROTECTED]> wrote:

 well, as far as I know, statefull are recreated every JNDI lookup, so you
need to hold a reference to it, as long as you need it - the other is not
supposed to live longer than a single method call

I usually use them in a LoadableDataProvider or a LoadableModel, never
tried them direct in Pages - however, in components where they return a
small list of links (under 20).

Do you think this is dangerous to do?



 ------------------------------
*Von:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *Im Auftrag von *Johan
Compagner
*Gesendet:* Donnerstag, 28. Dezember 2006 18:15
*An:* wicket-user@lists.sourceforge.net
*Betreff:* Re: [Wicket-user] wicket-contrib-javaee moved to Wicket-Stuff

So both beans (statefull or stateless) are injected on every request?

On 12/28/06, Korbinian Bachl <[EMAIL PROTECTED] > wrote:
>
>  I believe there you have to differate:
>
> a; stateless-sessionbeans: those are only "living" for 1 method call,
> then returned to the EJB-pool, so i dont see here a danger
> b, stateful-sessionbeans: those are "living" over the request and have
> to be used in your Wicketsession and referenced there, they never (!) may be
> used in a wicket page itself without the wicket session use as they would
> break concurrent-user support and create a new bean every pageinstance
> recreation.
>
> Are I'm wrong here?
>
> Regards
>
> Korbinian
>
>  ------------------------------
> *Von:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *Im Auftrag von *Igor
> Vaynberg
> *Gesendet:* Donnerstag, 28. Dezember 2006 17:37
> *An:* wicket-user@lists.sourceforge.net
> *Betreff:* Re: [Wicket-user] wicket-contrib-javaee moved to Wicket-Stuff
>
>  lets not forget the important part, assuming the ejb thing works just
> like wicket-spring. things injected are actually proxies not beans
> themselves. these proxies can be serialized safely - they do not have a hard
> link to the underlying ejb bean. if you do not do this and keep a reference
> to an ejb bean in wicket components two things can happen:
>
> a) you get a not serializable exception when wicket/servlet container
> needs to serialize something
>
> b) worse, the bean is serializable and you drag it along with the wicket
> components into your session ending up with a useless clone
>
> -igor
>
>
> On 12/28/06, Filippo Diotalevi <[EMAIL PROTECTED]> wrote:
> >
> > On 12/28/06, Korbinian Bachl <[EMAIL PROTECTED]> wrote:
> > > Hi Filippo,
> > >
> > > just browsed through it and its really nice work. Especially if
> > someone
> > > wants to have EJB3 persitence but not to use EJB3 Stateless Session
> > Beans to
> > > query it.
> > >
> > > However, the thing with the EjbAnnotation looks not so clear to me -
> > i mean,
> > > every IDE has J5EE support and so in Neatbeans for example i just
> > need 2
> > > mouseclicks and i got my EJB called through a on the fly created
> > call
> > > (including web.xml ref. update/creation) e.g:
> >
> > Hi Korbinian,
> >   yes, you are right, you can create your lookup methods (with your
> > IDE or writing the classes), in the same way you can extract beans
> > from Spring calling applicationContext.get("beanName").
> >
> > However, I prefer to write less code and let the infrastructure be
> > responsible of doing all the boring stuff. Since Java EE 5 allows you
> > to inject ejb dependencies through the @EJB annotation, I thought it
> > would be useful to extend this functionality to wicket pages, in the
> > same way we have @SpringBean annotation for injecting spring beans.
> >
> > --
> >   Filippo Diotalevi
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to
> > share your
> > opinions on IT & business topics through brief surveys - and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> >
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
>
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
>

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to