File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
spring-jms/src/main/java/org/springframework/jms/connection Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -191,10 +191,20 @@ public void commitAll() throws JMSException {
191
191
try {
192
192
Method getDataSourceMethod = this .connectionFactory .getClass ().getMethod ("getDataSource" );
193
193
Object ds = ReflectionUtils .invokeMethod (getDataSourceMethod , this .connectionFactory );
194
- if (ds != null && TransactionSynchronizationManager .hasResource (ds )) {
195
- // IllegalStateException from sharing the underlying JDBC Connection
196
- // which typically gets committed first, e.g. with Oracle AQ --> ignore
197
- return ;
194
+ while (ds != null ) {
195
+ if (TransactionSynchronizationManager .hasResource (ds )) {
196
+ // IllegalStateException from sharing the underlying JDBC Connection
197
+ // which typically gets committed first, e.g. with Oracle AQ --> ignore
198
+ return ;
199
+ }
200
+ try {
201
+ // Check for decorated DataSource a la Spring's DelegatingDataSource
202
+ Method getTargetDataSourceMethod = ds .getClass ().getMethod ("getTargetDataSource" );
203
+ ds = ReflectionUtils .invokeMethod (getTargetDataSourceMethod , ds );
204
+ }
205
+ catch (NoSuchMethodException nsme ) {
206
+ ds = null ;
207
+ }
198
208
}
199
209
}
200
210
catch (Throwable ex2 ) {
You can’t perform that action at this time.
0 commit comments