tags:

views:

182

answers:

1

In some places I see that IsInitiating creates a new session. Other places say that it creates a new session only if needed. Which is correct?

Just to make it clear, I want to make sure I can call IService.Foo three times without three sessions being created.

+1  A: 

The first time an IsInitiating=true operation is called through a channel, the session begins. Future calls to IsInitiating=true operations do not start new sessions, they simply become part of the existing session. A session ends after an IsTerminating operation is called (this causes the client to close the channel). No further operations may be called through the channel once the IsTerminating operation returns. These properties give developers control over the order of operation invocation relative to the session lifetime.

Sorry, Here is a link to the source.

alex
Thanks, that is exactly what I was looking for.
Jonathan Allen