Skip to content

Commit

Permalink
Upgrade to H2 1.4.197
Browse files Browse the repository at this point in the history
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
  • Loading branch information
artembilan committed Mar 26, 2018
1 parent b93efd6 commit ed79a95
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ subprojects { subproject ->
hazelcastVersion = '3.6.1'
hibernateVersion = '5.1.0.Final'
hsqldbVersion = '2.3.3'
h2Version = '1.4.180'
h2Version = '1.4.197'
jackson2Version = '2.8.10'
javaxActivationVersion = '1.1.1'
javaxMailVersion = '1.5.6'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
Expand Down Expand Up @@ -54,6 +54,7 @@
* @author Gary Russell
* @author Artem Bilan
* @author Gunnar Hillert
*
* @since 2.0
*
*/
Expand Down Expand Up @@ -104,7 +105,7 @@ public void testKeyGeneration() {
assertNotNull(reply);

Map<String, ?> payload = (Map<String, ?>) reply.getPayload();
Object id = payload.get("SCOPE_IDENTITY()");
Object id = payload.get("ID");
assertNotNull(id);

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

payload = (Map<String, ?>) reply.getPayload();
id = payload.get("SCOPE_IDENTITY()");
id = payload.get("ID");
assertNotNull(id);
map = this.jdbcTemplate.queryForMap("SELECT * from BARS");
assertEquals("Wrong id", id, map.get("ID"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration/jdbc" xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:si="http://www.springframework.org/schema/integration" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jdbc="http://www.springframework.org/schema/jdbc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/jdbc
http://www.springframework.org/schema/integration/jdbc/spring-integration-jdbc.xsd">

<beans:import resource="jdbcOutboundChannelAdapterCommonConfig.xml" />

<si:channel id="output">
<si:queue />
</si:channel>
Expand All @@ -27,6 +27,4 @@
request-prepared-statement-setter="messagePreparedStatementSetter"
keys-generated="true" />

<beans:import resource="jdbcOutboundChannelAdapterCommonConfig.xml" />

</beans:beans>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
drop table foos;
drop table bars;
create table foos(id varchar(100),status int,name varchar(20));
create table bars(id int identity,status int,name varchar(20));
create table foos(id varchar(100), status int, name varchar(20));
create table bars(id int identity, status int, name varchar(20));

0 comments on commit ed79a95

Please sign in to comment.