rpuch commented on code in PR #1291:
URL: https://github.com/apache/ignite-3/pull/1291#discussion_r1011746145
##########
modules/transactions/src/test/java/org/apache/ignite/internal/tx/storage/state/TxStateStorageAbstractTest.java:
##########
@@ -150,10 +167,14 @@ public void testCas() throws Exception {
@Test
public void testScan() throws Exception {
- try (TxStateTableStorage tableStorage = createStorage()) {
- TxStateStorage storage0 =
tableStorage.getOrCreateTxStateStorage(0);
- TxStateStorage storage1 =
tableStorage.getOrCreateTxStateStorage(1);
- TxStateStorage storage2 =
tableStorage.getOrCreateTxStateStorage(2);
+ try (
+ var storageHolder0 = new
AutoCloser<>(tableStorage.getOrCreateTxStateStorage(0), TxStateStorage::close);
Review Comment:
On the other hand, the code with try-with-resources is safer, it closes the
storage.
Do you think it's not important in tests and should be replaced with simply
calling `close()` in the end?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]