Skip to content

Commit 0040913

Browse files
committed
[spring] fix for http://code.google.com/p/mybatis/issues/detail?id=548 . Respect databaseId if there was already one in mybatis-config.xml
1 parent 36b4e50 commit 0040913

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
390390
Environment environment = new Environment(this.environment, this.transactionFactory, this.dataSource);
391391
configuration.setEnvironment(environment);
392392

393-
if (this.databaseIdProvider != null) {
393+
if (configuration.getDatabaseId() == null && this.databaseIdProvider != null) {
394394
try {
395395
configuration.setDatabaseId(this.databaseIdProvider.getDatabaseId(this.dataSource));
396396
} catch (SQLException e) {

0 commit comments

Comments
 (0)