Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
iDempiere JIRA
Implement readonly query without using Trx
Description
Re-implement read only DB.get* method with Connection and hence without the overhead of Trx.
Environment
None
Activity
Carlos Ruiz
May 1, 2023 at 10:45 AM
Tested in oracle, the problem is exclusive from postgresql
Carlos Ruiz
May 1, 2023 at 9:38 AM
The problem is in DB_PostgreSQL.getNextID line 874
int m_sequence_id = DB.getSQLValueEx(trxName, "SELECT nextval('"+name.toLowerCase()+"')");
Carlos Ruiz
May 1, 2023 at 9:33 AM
Reopening this ticket.
Saving a preference is failing when native sequences are enabled.
Test case (reproduced in test.idempiere.org)
log in as System
run the Enable Native Sequence process
Cache Reset
open Test window
right click in Currency and select Value Preference
click OK
org.postgresql.util.PSQLException: ERROR: cannot execute nextval() in a read-only transaction[SQL: 0, 25006]
Re-implement read only DB.get* method with Connection and hence without the overhead of Trx.