{"record":{"id":"189129315141dcf0","repo":"apache/shardingsphere","slug":"can-not-find-field-name-s-in-class-s","errorCode":null,"errorMessage":"Can not find field name `%s` in class %s.","messagePattern":"Can not find field name `(.+?)` in class (.+?)\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"agent/plugins/core/src/main/java/org/apache/shardingsphere/agent/plugin/core/util/AgentReflectionUtils.java","lineNumber":47,"sourceCode":" */\n@NoArgsConstructor(access = AccessLevel.PRIVATE)\npublic final class AgentReflectionUtils {\n    \n    /**\n     * Get field value.\n     *\n     * @param target target\n     * @param fieldName field name\n     * @param <T> type of field value\n     * @return field value\n     * @throws IllegalStateException illegal state exception\n     */\n    public static <T> T getFieldValue(final Object target, final String fieldName) {\n        Optional<Field> field = findField(fieldName, target.getClass());\n        if (field.isPresent()) {\n            return getFieldValue(target, field.get());\n        }\n        throw new IllegalStateException(String.format(\"Can not find field name `%s` in class %s.\", fieldName, target.getClass()));\n    }\n    \n    @SuppressWarnings(\"unchecked\")\n    @SneakyThrows(IllegalAccessException.class)\n    private static <T> T getFieldValue(final Object target, final Field field) {\n        boolean accessible = field.isAccessible();\n        if (!accessible) {\n            field.setAccessible(true);\n        }\n        T result = (T) field.get(target);\n        if (!accessible) {\n            field.setAccessible(false);\n        }\n        return result;\n    }\n    \n    private static Optional<Field> findField(final String fieldName, final Class<?> targetClass) {\n        Class<?> currentTargetClass = targetClass;","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/agent/plugins/core/src/main/java/org/apache/shardingsphere/agent/plugin/core/util/AgentReflectionUtils.java#L29-L65","documentation":"Thrown by the Firebird frontend when a client attempts to start a new transaction while FirebirdTransactionIdGenerator reports an active transaction for the same connection. The proxy enforces at most MAX_CONCURRENT_TRANSACTIONS (=1 per connection) transactions, mirroring Firebird's single-active-transaction-per-connection model. ExcessTransactionsException signals a protocol misuse rather than a resource exhaustion.","triggerScenarios":"Sending a Firebird start-transaction packet on a connection where hasActiveTransaction(connectionId) is true: starting a second transaction without committing/rolling back the first, or after a failed commit/rollback path that did not close the tracked transaction.","commonSituations":"Client code that begins a transaction, hits an error path that skips commit/rollback, then begins another on the same connection; drivers that auto-begin transactions around each statement while an explicit transaction is open; state left over after an abnormal disconnect/reconnect on the same connection id.","solutions":["Commit or roll back the current transaction (and let the proxy close the handle) before issuing a new start-transaction on the same connection.","Audit error paths in client code to guarantee a terminal commit/rollback is always issued (try/finally).","If the client expects parallel transactions, use a separate connection per transaction — Firebird protocol here allows one per connection.","If the error appears after a prior failure, close and reopen the connection to reset tracked transaction state, then retry."],"exampleFix":"// before\nconn.startTransaction();\ntry {\n    doWork();\n} catch (Exception e) {\n    // forgot rollback; next startTransaction throws\n}\nconn.startTransaction();\n\n// after\nconn.startTransaction();\ntry {\n    doWork();\n    conn.commit();\n} catch (Exception e) {\n    conn.rollback();\n} finally {\n    conn.endTransaction(); // clears handle\n}","handlingStrategy":"validation","validationCode":"// Client-side guard before starting a Firebird transaction\nif (txHandle >= 0) throw new IllegalStateException(\"Transaction already active; commit or roll back first\");\ntxHandle = conn.startTransaction();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One transaction per connection at a time; use additional connections for parallel work.","Guarantee every begin has a matching commit/rollback via try/finally.","On unexpected errors, roll back and clear the handle before the next begin."],"tags":["firebird","transaction","concurrency","proxy-frontend"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}