PDA

View Full Version : Injecting non-singletons


Ted Husted
05-17-2005, 06:21 PM
I've noticed that when we inject a Plain-Old-Object into a Spring.NET page, it retains its state between requests, even if singleton is set to false.

We've set singleton=false in the object's element, and in the Web.config object element for the page, but the state is still retained across requests.

Is this because the injected property is part of the page class?

Our main concern is that the of our POOs is not shared between sessions.

-Ted.

jacksonpd
05-18-2005, 12:00 AM
I'm only new to the spring but ...

on the object tag there is a scope attribute which has the possible values 'application', 'session' or 'request'.

The one you are after is the <object ... scope="request"/>

Although I'm not sure what happens under the covers.