#vulnerable code 
                                @Test
    public void testSelectTransacted() {
        System.out.println("testSelectTransacted");
        db() //
                .select("select score from person where name=?") //
                .parameters("FRED", "JOSEPH") //
                .transacted() //
                .getAs(Integer.class) //
                .doOnNext(tx -> System.out.println(tx.isComplete() ? "complete" : tx.value())) //
                .test() //
                .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                .assertValueCount(3) //
                .assertComplete();
    } 
                            #location 6 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                @Test
    public void testSelectTransacted() {
        try (Database db = db()) {
            db //
                    .select("select score from person where name=?") //
                    .parameters("FRED", "JOSEPH") //
                    .transacted() //
                    .getAs(Integer.class) //
                    .doOnNext(tx -> System.out.println(tx.isComplete() ? "complete" : tx.value())) //
                    .test() //
                    .awaitDone(TIMEOUT_SECONDS, TimeUnit.SECONDS) //
                    .assertValueCount(3) //
                    .assertComplete();
        }
    }