Skip to content

Commit

Permalink
version up. (#348)
Browse files Browse the repository at this point in the history
version up.
  • Loading branch information
igapyon authored Apr 30, 2021
1 parent 941b597 commit 9fd108a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion deploy2demosite.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
OIYOKAN_VERSION=1.9.20210430e
OIYOKAN_VERSION=1.10.20210430g
export OIYOKAN_VERSION

mvn clean install
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>jp.oiyokan</groupId>
<artifactId>oiyokan</artifactId>
<version>1.9.20210430e</version>
<version>1.10.20210430g</version>
<name>oiyokan</name>
<description>Oiyokan is a simple OData v4 Server. (based on Apache
Olingo / Spring Boot / h2 database)</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/jp/oiyokan/OiyokanConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class OiyokanConstants {
/**
* Oiyokan のバージョン番号
*/
public static final String VERSION = "1.9.20210430e";
public static final String VERSION = "1.10.20210430g";

/**
* 実験的な $search 機能(全文検索)が有効化されているかどうか。
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/jp/oiyokan/common/OiyoCommonJdbcUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ public static List<String> executeDml(Connection connTargetDb, OiyoSqlInfo sqlIn

return generatedKeys;
} catch (SQLIntegrityConstraintViolationException ex) {
// [M202] Integrity constraint violation occured (DML). 制約違反.
// [IY3401] Integrity constraint violation occured (DML). 制約違反.
log.error(OiyokanMessages.IY3401 + ": " + sql + ", " + ex.toString());
// 制約違反については例外的に ex の getMessage についても呼出元に返却.
throw new ODataApplicationException(OiyokanMessages.IY3401 + ": " + sql + ": " + ex.getMessage(), //
Expand All @@ -793,7 +793,15 @@ public static List<String> executeDml(Connection connTargetDb, OiyoSqlInfo sqlIn
throw new ODataApplicationException(OiyokanMessages.IY3511 + ": " + sql, //
OiyokanMessages.IY3511_CODE, Locale.ENGLISH);
} catch (SQLException ex) {
if (ex.toString().indexOf("timed out") >= 0 /* SQL Server 2008 */) {
if (ex.toString().toLowerCase().contains("unique constraint")/* PostgreSQL */ //
|| ex.toString().toLowerCase().contains("重複したキー")/* SQLSV2008 */) {
// TODO message
// [IY3401] Integrity constraint violation occured (DML). 制約違反.
log.error(OiyokanMessages.IY3401 + ": " + sql + ", " + ex.toString());
// 制約違反については例外的に ex の getMessage についても呼出元に返却.
throw new ODataApplicationException(OiyokanMessages.IY3401 + ": " + sql + ": " + ex.getMessage(), //
OiyokanMessages.IY3401_CODE, Locale.ENGLISH);
} else if (ex.toString().toLowerCase().contains("timed out") /* SQL Server 2008 */ ) {
// [IY3512] SQL timeout at exec insert/update/delete.
log.error(OiyokanMessages.IY3512 + ": " + sql + ", " + ex.toString());
throw new ODataApplicationException(OiyokanMessages.IY3512 + ": " + sql, //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,17 @@ void test01() throws Exception {
ODataResponse resp = OiyokanTestUtil.callPatch("/ODataTest2(" + key + ")", "{\n" //
+ " \"Name\":\"Name2\",\n" //
+ " \"Description\":\"Description2\"\n" + "}", false, true);
assertEquals(201, resp.getStatusCode());

resp = OiyokanTestUtil.callGet( //
"/ODataTest2", OiyoUrlUtil.encodeUrlQuery("$select=Decimal1,StringChar8,StringVar255"));
@SuppressWarnings("unused")
String result = OiyokanTestUtil.stream2String(resp.getContent());
// System.err.println(result);
if (201 == resp.getStatusCode()) {
resp = OiyokanTestUtil.callGet( //
"/ODataTest2", OiyoUrlUtil.encodeUrlQuery("$select=Decimal1,StringChar8,StringVar255"));
@SuppressWarnings("unused")
String result = OiyokanTestUtil.stream2String(resp.getContent());
// System.err.println(result);
}

// INSERTした後なので存在する
resp = OiyokanTestUtil.callGet("/ODataTest2(" + key + ")", null);
result = OiyokanTestUtil.stream2String(resp.getContent());
String result = OiyokanTestUtil.stream2String(resp.getContent());
System.err.println(result);
assertEquals(200, resp.getStatusCode());

Expand Down

0 comments on commit 9fd108a

Please sign in to comment.