revised JMS CachedConnectionFactory to avoid unnecessary rollback calls on Session return (SPR-8437); fixed JMS CachedConnectionFactory to fully synchronize its Session list (SPR-8436)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@4523 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller 2011-06-13 22:32:42 +00:00
parent c2ca360138
commit 22d5a23a54
1 changed files with 5 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2009 the original author or authors. * Copyright 2002-2011 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -475,9 +475,7 @@ public class SingleConnectionFactoryTests extends TestCase {
con.createSession(true, Session.AUTO_ACKNOWLEDGE); con.createSession(true, Session.AUTO_ACKNOWLEDGE);
conControl.setReturnValue(txSession, 1); conControl.setReturnValue(txSession, 1);
txSession.getTransacted(); txSession.getTransacted();
txSessionControl.setReturnValue(true, 2); txSessionControl.setReturnValue(true, 1);
txSession.rollback();
txSessionControl.setVoidCallable(1);
txSession.commit(); txSession.commit();
txSessionControl.setVoidCallable(1); txSessionControl.setVoidCallable(1);
txSession.close(); txSession.close();
@ -539,9 +537,9 @@ public class SingleConnectionFactoryTests extends TestCase {
con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE); con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
conControl.setReturnValue(txSession, 1); conControl.setReturnValue(txSession, 1);
txSession.getTransacted(); txSession.getTransacted();
txSessionControl.setReturnValue(true, 2); txSessionControl.setReturnValue(true, 1);
txSession.rollback(); txSession.rollback();
txSessionControl.setVoidCallable(2); txSessionControl.setVoidCallable(1);
txSession.close(); txSession.close();
txSessionControl.setVoidCallable(1); txSessionControl.setVoidCallable(1);
con.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE); con.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);
@ -601,9 +599,7 @@ public class SingleConnectionFactoryTests extends TestCase {
con.createTopicSession(true, Session.AUTO_ACKNOWLEDGE); con.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
conControl.setReturnValue(txSession, 1); conControl.setReturnValue(txSession, 1);
txSession.getTransacted(); txSession.getTransacted();
txSessionControl.setReturnValue(true, 4); txSessionControl.setReturnValue(true, 2);
txSession.rollback();
txSessionControl.setVoidCallable(2);
txSession.close(); txSession.close();
txSessionControl.setVoidCallable(1); txSessionControl.setVoidCallable(1);
con.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE); con.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);