I dont think so. Appears to be working fine in local testing.
My main concern is understanding it enough so there are not surprises after deployment and am able to support and troubleshoot.
Having looked at it further in a debugger, the two sessions are created in the following methods:
1. JmsServerSessionPool.setupSessions()
session.setup();
2. JmsServerSessionPool.setupConsumer()
consumer = connection.createConnectionConsumer(queue, selector, this, maxMessages);
Looking at the resulting consumer object shows, I think I can see each of the session objects:
consumer (id=763)
_closed false
_connection TibjmsQueueConnection (id=435)
_consumer TibjmsQueueReceiver (id=768)
_destination TibjmsFederatedQueue (id=769)
_durableName null
_lock Object (id=771)
_max_messages 1
_messages Vector<E> (id=773)
_pool JmsServerSessionPool (id=413)
activation JmsActivation (id=418)
consumer TibjmsConnectionConsumer (id=763)
serverSessions ArrayList<E> (id=794)
elementData Object[10] (id=800)
[0] JmsServerSession (id=801)
endpoint $Proxy14 (id=803)
pool JmsServerSessionPool (id=413)
session TibjmsxSessionImp (id=807) <---------- Session in pool created by JmsServerSessionPool.setupSessions -> session.setup();
tm TransactionManagerDelegate (id=808)
xaSession null
modCount 1
size 1
sessionCount 1
stopped false
_receiver Thread (id=762)
_selector null
_session TibjmsQueueSession (id=778) <---------- Session in consumer object created by JmsServerSessionPool.setupConsumer -> connection.createConnectionConsumer(queue, selector, this, maxMessages);
The method connection.createConnectionConsumer(queue, selector, this, maxMessages) creates TibjmsConnectionConsumer object and is Tibco implemented code so I can't say much about it.
The consumer object appears to have its own session, which is additional to those in the session pool.
Assuming the Tibco method is doing the right thing with that additional session, then otherwise the resource adapter appears to be doing the right thing.