{"record":{"id":"2b6387b14d25f6d3","repo":"quarkusio/quarkus","slug":"person-quarkus-doesn-t-exist-when-it-should","errorCode":null,"errorMessage":"Person Quarkus doesn't exist when it should","messagePattern":"Person Quarkus doesn't exist when it should","errorType":"http","errorClass":"RuntimeException","httpStatus":500,"severity":"error","filePath":"integration-tests/jpa-mariadb/src/main/java/io/quarkus/it/jpa/mariadb/JPAFunctionalityTestEndpoint.java","lineNumber":79,"sourceCode":"            }\n            if (!allpersons.get(0).getName().equals(\"Gizmo\")) {\n                throw new RuntimeException(\"Incorrect order of results\");\n            }\n            StringBuilder sb = new StringBuilder(\"list of stored Person names:\\n\\t\");\n            for (Person p : allpersons) {\n                p.describeFully(sb);\n            }\n            sb.append(\"\\nList complete.\\n\");\n            System.out.print(sb);\n        });\n\n        //Try to use prepared statement with setObject:\n        try (PreparedStatement ps = ds.getConnection().prepareStatement(\"select * from Person as p where p.name = ?\")) {\n            ps.setObject(1, \"Quarkus\");\n            final ResultSet resultSet = ps.executeQuery();\n\n            if (!resultSet.next()) {\n                throw new RuntimeException(\"Person Quarkus doesn't exist when it should\");\n            }\n        }\n\n        //Try a JPA named query:\n        QuarkusTransaction.requiringNew().run(() -> {\n            TypedQuery<Person> typedQuery = em.createNamedQuery(\n                    \"get_person_by_name\", Person.class);\n            typedQuery.setParameter(\"name\", \"Quarkus\");\n            final Person singleResult = typedQuery.getSingleResult();\n\n            if (!singleResult.getName().equals(\"Quarkus\")) {\n                throw new RuntimeException(\"Wrong result from named JPA query\");\n            }\n        });\n\n        //Check that HQL fetch does not throw an exception\n        QuarkusTransaction.requiringNew()\n                .run(() -> em.createQuery(\"from Person p left join fetch p.address a\").getResultList());","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/integration-tests/jpa-mariadb/src/main/java/io/quarkus/it/jpa/mariadb/JPAFunctionalityTestEndpoint.java#L61-L97","documentation":"This integration-test endpoint verifies seeded data by executing raw JDBC (PreparedStatement with setObject(\"Quarkus\")) and expects at least one Person row named 'Quarkus'; if the result set is empty it throws this RuntimeException. It means the test fixture data was not persisted/committed or is not visible to the connection.","triggerScenarios":"GET the endpoint when the Person 'Quarkus' insert never ran, rolled back, or was written to another database/schema than the DataSource used for the select.","commonSituations":"Database not initialized or flyway/seed scripts missing; pointing quarkus.datasource at the wrong MariaDB database/container; transaction isolation or a rolled-back transaction hiding the insert; cleanup from a previous test run deleted the row.","solutions":["Confirm the seed transaction that persists Person 'Quarkus' committed before the query runs","Verify quarkus.datasource.jdbc.url points at the database where the data was inserted","Check container/test data setup ran (docker/MariaDB testcontainer up, schema created)","Re-run cleanUpData + persist step, then verify with a direct SQL client"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"try (Connection c = ds.getConnection();\n     PreparedStatement ps = c.prepareStatement(\"select count(*) from Person where name = ?\")) {\n    ps.setString(1, \"Quarkus\");\n    try (ResultSet rs = ps.executeQuery()) {\n        rs.next();\n        if (rs.getInt(1) == 0) throw new IllegalStateException(\"Seed data missing: Person 'Quarkus'\");\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    runEndpointTest();\n} catch (RuntimeException e) {\n    if (e.getMessage().contains(\"Person Quarkus doesn't exist\")) {\n        // re-seed data / verify datasource URL, then retry once\n    }\n}","preventionTips":["Seed data inside a committed transaction before assertions","Point the datasource at the same DB the seed writes to","Reset DB state at test start (cleanUpData + seed)","Never run DB integration tests in parallel on a shared schema"],"tags":["jpa","jdbc","mariadb","integration-test"],"backgroundTag":"test-fixture-data-missing","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}