Skip to content

Commit ed79a95

Browse files
committed
Upgrade to H2 1.4.197
https://build.spring.io/browse/INT-FATS5IC-457 The H2 `1.4.197` has fixed some issues (in particular h2database/h2database#178) and introduced some breaking changes for us, although they are reasonably good. * Fix `JdbcOutboundGatewayParserTests` to use correct identifiers for returned generated keys instead of previously used `SCOPE_IDENTITY()` **Cherry-pick to 5.0.x and 4.3.x** (cherry picked from commit 7b86ca7) # Conflicts: # build.gradle
1 parent b93efd6 commit ed79a95

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ subprojects { subproject ->
101101
hazelcastVersion = '3.6.1'
102102
hibernateVersion = '5.1.0.Final'
103103
hsqldbVersion = '2.3.3'
104-
h2Version = '1.4.180'
104+
h2Version = '1.4.197'
105105
jackson2Version = '2.8.10'
106106
javaxActivationVersion = '1.1.1'
107107
javaxMailVersion = '1.5.6'

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/JdbcOutboundGatewayParserTests.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,6 +54,7 @@
5454
* @author Gary Russell
5555
* @author Artem Bilan
5656
* @author Gunnar Hillert
57+
*
5758
* @since 2.0
5859
*
5960
*/
@@ -104,7 +105,7 @@ public void testKeyGeneration() {
104105
assertNotNull(reply);
105106

106107
Map<String, ?> payload = (Map<String, ?>) reply.getPayload();
107-
Object id = payload.get("SCOPE_IDENTITY()");
108+
Object id = payload.get("ID");
108109
assertNotNull(id);
109110

110111
Map<String, Object> map = this.jdbcTemplate.queryForMap("SELECT * from BARS");
@@ -119,7 +120,7 @@ public void testKeyGeneration() {
119120
assertNotNull(reply);
120121

121122
payload = (Map<String, ?>) reply.getPayload();
122-
id = payload.get("SCOPE_IDENTITY()");
123+
id = payload.get("ID");
123124
assertNotNull(id);
124125
map = this.jdbcTemplate.queryForMap("SELECT * from BARS");
125126
assertEquals("Wrong id", id, map.get("ID"));

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/config/handlingKeyGenerationJdbcOutboundGatewayTest.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc" xmlns:beans="http://www.springframework.org/schema/beans"
33
xmlns:si="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
54
xsi:schemaLocation="http://www.springframework.org/schema/beans
65
http://www.springframework.org/schema/beans/spring-beans.xsd
7-
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
86
http://www.springframework.org/schema/integration
97
http://www.springframework.org/schema/integration/spring-integration.xsd
108
http://www.springframework.org/schema/integration/jdbc
119
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">
1210

11+
<beans:import resource="jdbcOutboundChannelAdapterCommonConfig.xml" />
12+
1313
<si:channel id="output">
1414
<si:queue />
1515
</si:channel>
@@ -27,6 +27,4 @@
2727
request-prepared-statement-setter="messagePreparedStatementSetter"
2828
keys-generated="true" />
2929

30-
<beans:import resource="jdbcOutboundChannelAdapterCommonConfig.xml" />
31-
3230
</beans:beans>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
drop table foos;
22
drop table bars;
3-
create table foos(id varchar(100),status int,name varchar(20));
4-
create table bars(id int identity,status int,name varchar(20));
3+
create table foos(id varchar(100), status int, name varchar(20));
4+
create table bars(id int identity, status int, name varchar(20));

0 commit comments

Comments
 (0)