PDA

View Full Version : Questions on IConfigureLifeTime of SAOExporter


ananthar
10-31-2006, 02:05 PM
Hi,

I implemented Spring Remoting over IIS and had my objects exposed through SAOExporter.
It so happens that if I set the Property Infinite = false in the Spring.Config on the server end, after a few minutes, Spring stops exposing the service.
And I get the error when trying to connect from the client.

If I set Property Infinite=true, I did not face this error. But want to make sure if there are any overheads by doing the same ? Does this object remain in memory for ever? Is it alright to set this property to true?

Do let me know.

Regards,
Anantha

Bruno Baia
10-31-2006, 08:47 PM
Hi Anantha,

Infinite is set to true by default in Spring.NET, so if your are using the SAOExporter in a singleton mode, your object will remain available to your clients while the application is running.
So now it depends of what your need, you can also set infinite to false and use the InitialLeaseTime/RenewOnCallTime/SponsorshipTimeout properties.

Hope this helps,
Bruno

ananthar
11-02-2006, 11:25 AM
Hi Bruno,

Thank you for the response. Had a question though - on IIS - if I configure a remotable object to SingleCall , I still can access it whenever required - despite it being not singleton.

Using SAOExporters - if Infinite is set to true - it is going to act as a singleton. If not, then We will have to configure RenewOnCall or InitialLeaseTime.

The problem with this is , when in production - these objects have to be active as long as the IIS is active - and IIS will be running till the administrator manually wants to refresh it.

How do I work around this issue? I do not want the object to be singleton but still I want it to be active till the IIS is?

Regards.
Anantha

Bruno Baia
11-03-2006, 12:00 AM
Hi,

the target object just needs to be a prototype (singleton=false) if you want that your remote object acts in a SingleCall mode :


<object id="prototypeCalculator" type="Spring.Calculator.Services.AdvancedCalculator, Spring.Calculator.Services"
singleton="false">
<constructor-arg type="int" value="217"/>
</object>

<r:SaoExporter targetName="prototypeCalculator" serviceName="RemotedSaoSingleCallCalculator" />


Hope this helps,
Bruno