tristaZero commented on issue #2923: when using EncryptPreparedStatement to 
savebatch occours error
URL: 
https://github.com/apache/incubator-shardingsphere/issues/2923#issuecomment-528702306
 
 
   @xiyelife Hi, if first one is done, the second one, i think, there is a 
easier way to do. 
   
   As we said before, it is needed to cache the value of `setQueryTime()` and 
when call execute(), this operation will be really  performed.
   
   Currently, `setQueryTime()` in AbstractStatementAdapter.java has cached the 
value, here it is,
   ```
   @SuppressWarnings("unchecked")
       @Override
       public final void setQueryTimeout(final int seconds) throws SQLException 
{
          // cache the value
           recordMethodInvocation(targetClass, "setQueryTimeout", new Class[] 
{int.class}, new Object[] {seconds});
           forceExecuteTemplate.execute((Collection) getRoutedStatements(), new 
ForceExecuteCallback<Statement>() {
           
               @Override
               public void execute(final Statement statement) throws 
SQLException {
                   statement.setQueryTimeout(seconds);
               }
           });
       }
   ```
   So, we just call `replayMethodsInvocation()` in EncryptPreparedStatement 
when call execute() or executeUpdate().
   
   That's all, how about you? 
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to