The detach method should be called by the component that uses the model,
there should be no need for you to call detach manually.
Artur W. wrote:
>
> Hi,
>
> When I create LoadableDetachableModel the onDeatch() and deatch() methods
> are never called.
> The load method is only called once. Becouse of it I get
> LazyInitializationException from Hibernate.
>
> Should I call deatch() manually or is there something wrong with my
> LoadableDetachableModel?
>
> Here is a code.
>
> public class ClientLoadableDetachableModel extends LoadableDetachableModel
> {
>
> private Long clientId;
>
> public ClientLoadableDetachableModel(Long clientId) {
> super();
> this.clientId = clientId;
> }
>
> @Override
> protected Object load() {
> return Locator.getClientService().findClientById(clientId);
> }
>
> public Client getClient() {
> return (Client) super.getObject();
> }
>
> public Long getClientId() {
> return clientId;
> }
>
> }
>
>
> Thanks for help,
> Artur
>
>
-----
Michael Sparer
http://talk-on-tech.blogspot.com
--
View this message in context:
http://www.nabble.com/LoadableDetachableModel---should-I-call-deatch%28%29-manually--tp18335895p18340483.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]