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]

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created December 2, 2022 at 1:34 PM
Updated June 1, 2023 at 12:17 PM
Resolved May 1, 2023 at 3:08 PM