WebLogic Messaging API Class Library

IConnection.CreateSession\xA0Method\xA0

Creates an ISession object.

Warning: While an IConnection object supports multi-threaded access, an ISession object only supports single threaded access and multi-threaded behavior is undefined. If an application requires multiple concurrently active consumers and/or producers, then the application must create multiple sessions. See the WebLogic .NET programmer's guide best practices section for additional details on properly coding applications for thread safety when using sessions and their child messages, consumers, and producers; also see the API class doc for WebLogic.Messaging.ISession.

ISession\xA0CreateSession(
\xA0\xA0\xA0Constants.SessionMode\xA0sessionMode
);

Parameters

Constants.SessionMode
Indicates either if session is transacted or if the consumer or the client will Acknowledge any messages it receives; Legal values are Constants.SessionMode.AUTO_ACKNOWLEDGE, Constants.SessionMode.CLIENT_ACKNOWLEDGE, Constants.SessionMode.DUPS_OK_ACKNOWLEDGE, Constants.SessionMode.NO_ACKNOWLEDGE, and Constants.SessionMode.SESSION_TRANSACTED.

Return Value

a newly created session

Exceptions

Exception TypeCondition
MessageExceptionif the IConnection object fails to create a session due to some internal error or lack of support for the specific SessionMode.

See Also

IConnection Interface | WebLogic.Messaging Namespace | AUTO_ACKNOWLEDGE | CLIENT_ACKNOWLEDGE | NO_ACKNOWLEDGE | DUPS_OK_ACKNOWLEDGE | SESSION_TRANSACTED