Copyright © TIBCO Software Inc. All Rights Reserved

> tibems_SetAllowCloseInCallback
> Function
> Purpose
> Sets whether client applications can close message consumers, sessions, or connections inside message listener callbacks.
> C Declaration
> tibems_status tibems_SetAllowCloseInCallback(
> tibems_bool allow);
> COBOL Call
> CALL "tibems_SetAllowCloseInCallback",
> USING BY VALUE isAllowed,
> RETURNING tibems-status
> END-CALL.
> Parameters

> Parameter | Description
> allow | When true, the application will not wait for the message callbacks to return before closing a message consumer, session, or connection. When false, the application waits for the callback to return. By default, the application behavior is to wait for callbacks.

> Remarks
> This function can be used to change the default EMS client behavior, and set whether the client application can call tibemsMsgConsumer_Close, tibemsSession_Close, or tibemsConnection_Close functions from the tibemsMsgCallback.
> The default behavior is to wait for callbacks and parallel the behavior specified in the JMS specification, which the EMS client API adheres to. However, this function allows applications to override the default behavior and close EMS objects inside message callbacks.
> Normally, the C client API will wait for the tibemsMsgCallback callback to return before the close functions can return to the calling application. Consequently, if these close functions are called inside the callback it causes a deadlock. If calling close functions inside the callback is allowed, then the close function will not wait for the tibemsMsgCallback to return. This prevents the deadlock.
> See Also
> tibemsMsgCallback on page 172
> tibemsMsgConsumer_Close on page 163
> tibemsConnection_Close on page 204
> tibemsSession_Close on page 289
> tibems_GetAllowCloseInCallback on page 380

Copyright © TIBCO Software Inc. All Rights Reserved