wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bas Gooren <...@iswd.nl>
Subject Re: wicket-guice and recursive injection of non serializable JPA2 objects
Date Wed, 15 Jun 2016 06:17:04 GMT
Dieter,

Since the data provider is inject as a proxy, only the proxy should be
serialized. On deserialization it should look up the actual data
provider again.

Can you share some code so we can see how you set things up? What you
are trying is something that should work out of the box - it does for
us.

Bas

Verstuurd vanaf mijn iPhone

> Op 15 jun. 2016 om 07:53 heeft Dieter Tremel <tremel@tremel-computer.de> het volgende
geschreven:
>
> Hallo wicket-user,
>
> IMHO combining wicket with non serializable objects is a challenging topic.
>
> On a page I have a DataProvider, that is injected by wicked-guice.
> Inside this provider an injected dao is used for fetching the data.
> Inside the dao a provider for a JPA2 entity manager (EclipseLink) is
> injected.
>
> Page -> DataProvider -> Dao -> Provider<EntityManager>
>
> Seems to be useful, but since the page is stateful I recognized the non
> serializeable error for the dao at the end of page rendering.
>
> After some code studies I think wicket-guice is only using a proxy for
> the DataProvider, the second second and third level of injection is done
> only by guice, not handled by wicket-guice and wicket-ioc. This causes
> serializable error for dao. Am I right here? wicket-guice is not as
> useful as it could be, if it would not be restricted to the fields in
> the first level. Setter injection is another topic. The name-pair lets
> associate a transparent combination of the two technologies, but it isn't.
>
> At the moment I have no solution for this.
> I still struggle with the right architecture fore using generic JPA2
> provided entities on my pages. The only idea so far is not to use guice
> and use the application as a link to the non serializable JPA objects
> and using detachable models to handle the on pages.
>
> Any hints for my confused mind welcome. Thanks!
>
> Dieter Tremel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Mime
View raw message