From: Dan <dan@scapps.co.uk>
To: pgsql-jdbc@lists.postgresql.org
Subject: Configuring Hibernate for PostgreSQL Access Over Unix Socket With JDBC
Date: Sun, 8 Dec 2019 12:13:55 +0000
Message-ID: <adab8102-6e97-e2b8-c7fd-2c741b8135f5@scapps.co.uk> (raw)
In-Reply-To: <157580485223.6591.10998780803617504400@malur.postgresql.org>
References: <157580485223.6591.10998780803617504400@malur.postgresql.org>
Hello,
I hope it is appropriate to send this question to this address. If not,
kindly redirect me.
I am trying to configure Hibernate to use a Unix socket connection to my
local PostgreSQL installation. I have referred to this doc:
https://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters
and have been trying entries in hibernate.cfg.xml along these lines:
<property
name="hibernate.connection.url">jdbc:postgresql:kokodoko?socketFactory=org.newsclub.net.unix.socketfactory.PostgresqlAFUNIXSocketFactory&socketFactoryArg=/var/run/postgresql/.s.PGSQL.5432</property>
The XML validator in Eclipse is flagging this error:
The reference to entity "socketFactoryArg" must end with the ';'
delimiter.
(Of course I have tried many variations such as inserting semicolons in
various places, quoting the argument, using square brackets and so on.)
If I ignore the error and try to use config file I get this error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message":
"org.hibernate.internal.util.config.ConfigurationException: Unable to
perform unmarshalling at line number 0 and column 0 in RESOURCE
hibernate.cfg.xml. Message: null"
}
],
"code": 503,
"message":
"org.hibernate.internal.util.config.ConfigurationException: Unable to
perform unmarshalling at line number 0 and column 0 in RESOURCE
hibernate.cfg.xml. Message: null"
}
}
which I take to mean that the config file is unusable.
Is what I am trying to do (Hibernate, JDBC, PostgreSQL,
hibernate.cfg.xml, Unix socket) possible? If so, kindly give me some
guidance. If not, can you suggest a different approach that uses a Unix
socket?
I am posting a similar request on the Hibernate forum.
Thanks very much.
-Dan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: dan@scapps.co.uk
Subject: Re: Configuring Hibernate for PostgreSQL Access Over Unix Socket With JDBC
In-Reply-To: <adab8102-6e97-e2b8-c7fd-2c741b8135f5@scapps.co.uk>
References: <157580485223.6591.10998780803617504400@malur.postgresql.org> <adab8102-6e97-e2b8-c7fd-2c741b8135f5@scapps.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox