[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-529180180 @xiyelife Hi, Busy though you are, yet you raize [this pr](https://github.com/apache/incubator-shardingsphere/pull/3000). Thanks a lot. In addition, The problem of ShardingPreparedStatement was solved by @sunbufu [Here](https://github.com/apache/incubator-shardingsphere/pull/2999). So take it easy. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528332022 Got it, maybe we can split this task to two small ones. First, if preparedStatemnt == null in getRoutedStatements(), emptyList will be returned. This step will stop NPE, but `set queryTime()` actually is not executed, for there is no preparedStatement. Second, we may cache the value of `queryTime()` in AbstractStatementAdapter.java. When executeUpdate() or execute() is called, at this time, we relay the action, i.e, setQueryTime(). What's your opinion? we can do first one, i think. @xiyelife This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528244617 The problem of interchanged column was solved at [#2975](https://github.com/apache/incubator-shardingsphere/pull/2975) yesterday. Thanks, and wait for your pr. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528232286 @xiyelife Thanks for [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) as well. Moreover, can you make this pr become better? Actually, the solution in this pr can just stop NPE, but it is necessary to sovle it completely, so we should change our mind to stop NPE at beginning. I suggest we can create a preparedStatement upon EncryptPreparedStatement is created, i.e, we should move `preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());` from execute() or executeUpdate() to all the constructors of EncryptPreparedStatement. Therefore once EncryptPreparedStatement is created, the preparedStatement will be created as well, then NPE will never happen. If you have other advices, please contact me, or maybe you can modify [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) to perfect it. Here are the related code ``` public EncryptPreparedStatement(final EncryptConnection connection, final String sql) { this.sql = sql; preparedStatementGenerator = new EncryptPreparedStatementGenerator(connection); } --- @Override public int executeUpdate() throws SQLException { try { SQLUnit sqlUnit = getSQLUnit(sql); preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql()); replaySetParameter(preparedStatement, sqlUnit.getParameters()); return preparedStatement.executeUpdate(); } finally { clearParameters(); } } ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528232286 @xiyelife Thanks for [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) as well. Moreover, can you make this pr become better? Actually, the solution in this pr can just stop NPE, but it is necessary to sovle it completely, so we should change our mind to stop NPE at beginning. I suggest we can create a preparedStatement upon EncryptPreparedStatement is created, i.e, we should move `preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());` from execute() or executeUpdate() to all the constructors of EncryptPreparedStatement. Therefore once EncryptPreparedStatement is created, the preparedStatement will be created as well, then NPE will never happen. If you have other advices, please contact me, or maybe you can modify [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) to perfect it. Here are the related codes ``` public EncryptPreparedStatement(final EncryptConnection connection, final String sql) { this.sql = sql; preparedStatementGenerator = new EncryptPreparedStatementGenerator(connection); } --- @Override public int executeUpdate() throws SQLException { try { SQLUnit sqlUnit = getSQLUnit(sql); preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql()); replaySetParameter(preparedStatement, sqlUnit.getParameters()); return preparedStatement.executeUpdate(); } finally { clearParameters(); } } ``` This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528232286 @xiyelife Thanks for [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) as well. Moreover, can you make this pr become better? Actually, the solution in this pr can just stop NPE, but it is necessary to sovle it completely, so we should change our mind to stop NPE at beginning. I suggest we can create a preparedStatement upon EncryptPreparedStatement is created, i.e, we should move `preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());` from execute() or executeUpdate() to all the constructors of EncryptPreparedStatement. Therefore once EncryptPreparedStatement is created, the preparedStatement will be created as well, then NPE will never happen. If you have other advices, please contact me, or maybe you can modify [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) to perfect it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [incubator-shardingsphere] tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error
tristaZero edited a comment on issue #2923: when using EncryptPreparedStatement to savebatch occours error URL: https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528232286 @xiyelife Thanks for [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) as well. Moreover, can you make this pr become better? Actually, the solution in this pr can just stop NPE, but it is necessary to sovle it completely, so we should change our mind to stop NPE at beginning. --- I suggest we can create a preparedStatement upon EncryptPreparedStatement is created, i.e, we should move `preparedStatement = preparedStatementGenerator.createPreparedStatement(sqlUnit.getSql());` from execute() or executeUpdate() to all the constructors of EncryptPreparedStatement. --- Therefore once EncryptPreparedStatement is created, the preparedStatement will be created as well, then NPE will never happen. --- If you have other advices, please contact me, or maybe you can modify [your kind pr](https://github.com/apache/incubator-shardingsphere/pull/2977) to perfect it. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services