polishing
This commit is contained in:
parent
0b078f2ff9
commit
b21e1ee669
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2008 the original author or authors.
|
||||
* Copyright 2002-2011 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
@ -19,7 +19,6 @@ package org.springframework.jdbc.datasource;
|
|||
import java.lang.reflect.Method;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
|
|
@ -141,7 +140,7 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
|
|||
}
|
||||
// Create Connection through invoking WSDataSource.getConnection(JDBCConnectionSpec)
|
||||
return (Connection) ReflectionUtils.invokeJdbcMethod(
|
||||
this.wsDataSourceGetConnectionMethod, getTargetDataSource(), new Object[] {connSpec});
|
||||
this.wsDataSourceGetConnectionMethod, getTargetDataSource(), connSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -162,16 +161,16 @@ public class WebSphereDataSourceAdapter extends IsolationLevelDataSourceAdapter
|
|||
|
||||
Object connSpec = ReflectionUtils.invokeJdbcMethod(this.newJdbcConnSpecMethod, null);
|
||||
if (isolationLevel != null) {
|
||||
ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, new Object[] {isolationLevel});
|
||||
ReflectionUtils.invokeJdbcMethod(this.setTransactionIsolationMethod, connSpec, isolationLevel);
|
||||
}
|
||||
if (readOnlyFlag != null) {
|
||||
ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, new Object[] {readOnlyFlag});
|
||||
ReflectionUtils.invokeJdbcMethod(this.setReadOnlyMethod, connSpec, readOnlyFlag);
|
||||
}
|
||||
// If the username is empty, we'll simply let the target DataSource
|
||||
// use its default credentials.
|
||||
if (StringUtils.hasLength(username)) {
|
||||
ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, new Object[] {username});
|
||||
ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, new Object[] {password});
|
||||
ReflectionUtils.invokeJdbcMethod(this.setUserNameMethod, connSpec, username);
|
||||
ReflectionUtils.invokeJdbcMethod(this.setPasswordMethod, connSpec, password);
|
||||
}
|
||||
return connSpec;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -396,7 +396,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
* <p>Default is "false", throwing an exception if a non-default isolation level
|
||||
* is specified for a transaction. Turn this flag on if affected resource adapters
|
||||
* check the thread-bound transaction context and apply the specified isolation
|
||||
* levels individually (e.g. through a IsolationLevelDataSourceRouter).
|
||||
* levels individually (e.g. through an IsolationLevelDataSourceAdapter).
|
||||
* @see org.springframework.jdbc.datasource.IsolationLevelDataSourceAdapter
|
||||
* @see org.springframework.jdbc.datasource.lookup.IsolationLevelDataSourceRouter
|
||||
*/
|
||||
public void setAllowCustomIsolationLevels(boolean allowCustomIsolationLevels) {
|
||||
|
|
@ -878,12 +879,12 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
|||
* @see #getTransactionManager()
|
||||
*/
|
||||
protected void applyIsolationLevel(JtaTransactionObject txObject, int isolationLevel)
|
||||
throws InvalidIsolationLevelException, SystemException {
|
||||
throws InvalidIsolationLevelException, SystemException {
|
||||
|
||||
if (!this.allowCustomIsolationLevels && isolationLevel != TransactionDefinition.ISOLATION_DEFAULT) {
|
||||
throw new InvalidIsolationLevelException(
|
||||
"JtaTransactionManager does not support custom isolation levels by default - " +
|
||||
"switch 'allowCustomIsolationLevels' to 'true'");
|
||||
"switch 'allowCustomIsolationLevels' to 'true'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,14 +44,14 @@ public interface FlashMapManager {
|
|||
* {@code Map<String, Object>} with "input" flash attributes if any.
|
||||
* @see org.springframework.web.servlet.support.RequestContextUtils#getInputFlashMap(HttpServletRequest)
|
||||
*/
|
||||
public static final String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP";
|
||||
String INPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".INPUT_FLASH_MAP";
|
||||
|
||||
/**
|
||||
* Name of request attribute that holds the "output" {@link FlashMap} with
|
||||
* attributes to save for a subsequent request.
|
||||
* @see org.springframework.web.servlet.support.RequestContextUtils#getOutputFlashMap(HttpServletRequest)
|
||||
*/
|
||||
public static final String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP";
|
||||
String OUTPUT_FLASH_MAP_ATTRIBUTE = FlashMapManager.class.getName() + ".OUTPUT_FLASH_MAP";
|
||||
|
||||
/**
|
||||
* Perform the following tasks unless the {@link #OUTPUT_FLASH_MAP_ATTRIBUTE}
|
||||
|
|
|
|||
Loading…
Reference in New Issue