You shouldn't be using database connections. Use a service from your service layer. Inject the service with wicket-ioc / wicket-guice - it will insert a serializable proxy.
-- Jeremy Thomerson http://www.wickettraining.com On Tue, Apr 28, 2009 at 11:49 PM, Marc Ende <[email protected]> wrote: > Hmm... I'm not sure why it's done this way in the > AuthenticatedWebSession but > nevertheless it's the only task of a session object to keep informations > between > two requests. From this point of view a authenticate(String,String) > doesnt' really > make sense in the Class. May be there is someone here who can explain this > point. I wouldn't say that this is wrong, but unusual... :) > > May be you can get the database connection from inside the method for > authentication purposes, > Then you haven't got any private or public members which should be > serialized and contains a database connection. > > m. > > > Jan Torben Heuer schrieb: >> Marc Ende wrote: >> >> >>> webapps do. In this case you've got to serialize the connection. I don't >>> think that's easy/possible to seralize a database connection. >>> I would go another approach which uses the session only as a >>> information-container and get those needed information from the >>> database in the page-lifecycle. That keeps the session-object small >>> (which is also an aspect). >>> >> >> Hmm, following your argumentation, would you say that the >> AuthenticatedWebSession is implemented wrong because it contains a >> #authenticate method (which clearly needs a reference to some kind of >> database)? >> >> Or would marking the field as "transient" be fine? >> >> >> Cheers, >> >> Jan >> >> >> >> --------------------------------------------------------------------- >> 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]
