|
27 | 27 | import java.util.Collection; |
28 | 28 | import java.util.Date; |
29 | 29 | import java.util.TimeZone; |
30 | | -import java.util.function.IntSupplier; |
31 | 30 |
|
32 | 31 | import javax.sql.DataSource; |
33 | 32 |
|
@@ -300,21 +299,21 @@ public boolean set(int sequence, String message) throws IOException { |
300 | 299 |
|
301 | 300 | public void setNextSenderMsgSeqNum(int next) throws IOException { |
302 | 301 | cache.setNextSenderMsgSeqNum(next); |
303 | | - storeSequenceNumber(SQL_UPDATE_OUTGOING_SEQNUM, cache::getNextSenderMsgSeqNum); |
| 302 | + storeSequenceNumber(SQL_UPDATE_OUTGOING_SEQNUM, cache.getNextSenderMsgSeqNum()); |
304 | 303 | } |
305 | 304 |
|
306 | 305 | public void setNextTargetMsgSeqNum(int next) throws IOException { |
307 | 306 | cache.setNextTargetMsgSeqNum(next); |
308 | | - storeSequenceNumber(SQL_UPDATE_INCOMING_SEQNUM, cache::getNextTargetMsgSeqNum); |
| 307 | + storeSequenceNumber(SQL_UPDATE_INCOMING_SEQNUM, cache.getNextTargetMsgSeqNum()); |
309 | 308 | } |
310 | 309 |
|
311 | | - private void storeSequenceNumber(String sequenceUpdateSql, IntSupplier sequence) throws IOException { |
| 310 | + private void storeSequenceNumber(String sequenceUpdateSql, int sequence) throws IOException { |
312 | 311 | Connection connection = null; |
313 | 312 | PreparedStatement update = null; |
314 | 313 | try { |
315 | 314 | connection = dataSource.getConnection(); |
316 | 315 | update = connection.prepareStatement(sequenceUpdateSql); |
317 | | - update.setInt(1, sequence.getAsInt()); |
| 316 | + update.setInt(1, sequence); |
318 | 317 | setSessionIdParameters(update, 2); |
319 | 318 | update.execute(); |
320 | 319 | } catch (SQLException e) { |
|
0 commit comments