Why do I get 'Illegal use of receive() from multiple threads'
book
Article ID: KB0089290
calendar_today
Updated On:
Products
Versions
TIBCO Enterprise Message Service
-
Not Applicable
-
Description
Description: The exception, "Illegal use of receive() from multiple threads" could indicate that there are different threads
trying to call receive() on the same session at the same time.
The connection object is thread safe. Session is not thread safe, which means all
objects created by the same session (i.e., producers and consumers ) should be
only used in a single thread. EMS does not provide safe threaded access on the
same session.This does not mean
only one physical thread can access session objects as it can be done from many
threads, one at a time. If your application calls the same session (i.e., send
messages) from multiple threads simultaneously, then you should synchronize
access in your application.
Resolution
There is known issue in BW, which is fixed in BW 5.8 (BW-9693
)
If you can not determine the cause of the problem, collect the following information in order to investigate further.
1). How many threads are created in the program? Is it sharing the same connection
or creating connections within different threads?
2.). Send code to TIBCO Support that can reproduce the problem.
3). Add more log traces using the following tibemsadmin command. Reproduce the
issue and send TIBCO Support the EMS log.
set server log_trace=+CONNECT,+PRODCONS
4). Enable client tracing using the following tibemsadmin command. Reproduce the
issue and send the client trace log to TIBCO Support. By default, the client trace is sent to
stderr. You can redirect the error to file: $ application > client.log
2>&1
set server client_trace=enabled
Issue/Introduction
Why do I get 'Illegal use of receive() from multiple threads'