also when the last session is closed we keep the initial connection open. This can be used for deleting tempqueues als when the connection is actually closed
Currently when we create a new jms connection we only actually create a session if we are authenticating and then we close it once authentication has taken place.
I'm changing this so that firstly we always authorize and secondly caching the initial session and reusing it for the first actual session created. The only issue is that the initial core session is created with xa, autoCommitSends, autoCommitAcks and preAcknowledge set to false and ackBatchSize set to 0. O though the best thing was to add an extra method to core session to allow these values to be reset.
Not sure that is a good idea. You'd have to change the values on the server too, that means adding a new wire format message - pretty ugly.
I'd say just cache the special session locally in the jms connection and only use it for initial authorisation and delting temp queeus etc.
ok thats fine, I was just wondering how we would deal with this at a management leve, for instance the following test:
Connection connection = JMSUtil.createConnection(connectorFactory); connection.createSession(false, Session.AUTO_ACKNOWLEDGE); assertEquals(1, service.getServer().getConnectionCount());
would always fail since there are actually 2 connections, is that fine?
What test is that?
JMSServerControl2Test, the point is if there is 1 connection with 1 session, service.getServer().getConnectionCount() will return 2.
Well, are there two sessions or one session?
If you're creating two sessions now, then you need to reflect that in the asserts too, right?
aye, thats what Ive done.