AI Briefing
KO

Resolving the JDBC setReadOnly Call Issue

·2024.09.02 06:00

Key point

The AWS Aurora JDBC wrapper driver's topology query, executed when a transaction ends, was analyzed as the cause of setReadOnly errors.

1 / 2

Details

While operating Inflab's JVM servers, an intermittent issue was identified via Pinpoint where the error 'Cannot change transaction read-only property in the middle of a transaction' occurred.

Analysis showed that the error occurred inside the PostgreSQL JDBC driver at the moment a transaction ended. The cause was the Failover Plugin provided by the AWS JDBC wrapper driver.

This plugin runs a topology query using the aurora_replica_status() function to check the cluster status. The problem was structured such that when this query ran at the moment the transaction ended and its state changed to IDLE, the transaction state changed back to OPEN, and then setReadOnly was called afterward, causing a conflict.

The simplest solution would be to remove the wrapper driver, but since the Fast Failover feature is needed for high availability, identifying the root cause and optimizing the configuration appropriately is necessary.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.