Skip to content

PgConnection.setReadOnly() throws exception whenever you interact with it #2

@awal11

Description

@awal11

I am trying to use the driver together with PrestoDB. I encountered few issues, this would be the one of them.

Presto sets the JDBC driver to read only mode and this triggers an exception

org.postgresql.util.PSQLException: A result was returned when none was expected.
	at org.postgresql.jdbc.PgConnection.execSQLUpdate(PgConnection.java:440)
	at org.postgresql.jdbc.PgConnection.setReadOnly(PgConnection.java:699)
	at Main.main(Main.java:11)

no matter what I do

  1. without any prior configuration of the connection URL, just by invoking conn.setReadOnly(true);
  2. adding readonly=true suggested in Readme.md does nothing because it is case sensitive and should be readOnly=true
  3. if I add proper readOnly=true to the connection url - it throws exception directly from this line DriverManager.getConnection("jdbc:marklogic://localhost:8077/?readOnly=true","user","pw") as the PG driver was not adopted properly

AFAIK the driver will be always read only so my suggestion is to

  1. get rid of all the code related to handling readOnly
  2. fix the readme to indicate it more clearly

Would you accept a pull request to implement it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions