|
Problem |
When invoking an MDB, the following error might appear in
the SystemOut.log:
[2/21/06 10:38:36:292 EST] 00000095 MCWrapper E J2CA0079E: Method
setManagedConnection has detected an internal illegal state and is
throwing an IllegalStateException. The exception is:
java.lang.IllegalStateException: setManagedConnection: illegal state
exception. State = STATE_TRAN_WRAPPER_INUSE
at com.ibm.ejs.j2c.MCWrapper.setManagedConnection(MCWrapper.java:680)
...
at
com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:583)
at
com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle.createQueueConnection(JMSQueueConnectionFactoryHandle.java:84)
... |
|
Cause |
The ejbCreate method of the message driven bean invokes
the 'createQueueConnection' method which creates a queue connection for
later use.
Since an MDB is a stateless session bean, there is no guarantee that
any variables set on the first invocation of the bean will be the same on
the second invocation of the bean.
|
|
Solution |
The application code should be reviewed. Queue connection
factories and datasource connections should not be created during the
ejbCreate method.
Instead, they should be created immediately before they are used and
should be closed immediately after they are no longer required. |
|