pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Hastie <andrew@ahastie.net>
To: pgsql-jdbc@postgresql.org
Subject: OpenJPA problems running against PG 8.1
Date: Mon, 03 Oct 2011 11:14:36 +0100
Message-ID: <4E898B0C.5@ahastie.net> (raw)

Posting here for info only as I don't believe this is a "bug" as such, 
rather a change in behaviour:-

Latest 2.1.1 stable version of Apache OpenJPA project appears broken 
when running against Postgres when upgraded to v9.1. This I think is 
down to the changes in escape string handling in SQL LIKE clauses. 
Here's a link to the bug I've lodged against OpenJPA which includes 
details of how to configure an override at runtime to the default 
Postgres DBDictionary setting which will get things working again:-

http://openjpa.208410.n2.nabble.com/Postgres-V9-1-issue-with-LIKE-clause-and-Escape-Strings-td684806... 


Also copying here for info just in case:-

=======================================================
Noticed an issue with the Postgres DBDictionary definition after
updating Postgres from version 8.4 to 9.1:-

Here's what you get in the Postgres trace file when executing some JPA
driven queries where an SQL LIKE is involved:-

2011-09-30 14:29:41 BST ERROR:  invalid escape string
2011-09-30 14:29:41 BST HINT:  Escape string must be empty or one 
character.
2011-09-30 14:29:41 BST STATEMENT:  SELECT t0.id, t0.identificationMask,
t0.productName FROM DBTYPE t0 WHERE (t0.identificationMask LIKE $1
ESCAPE '\\')
2011-09-30 14:29:41 BST ERROR:  current transaction is aborted, commands
ignored until end of transaction block

This appears to be down to a change the Postgres project have made to
escape string handling:-
http://www.postgresql.org/docs/9.1/static/release-9-1.html (see
section E.2.2.1)

You appear to be able to override the default DBDictionary setting for
this as follows to get things working again:-
<property name="openjpa.jdbc.DBDictionary"
value="postgres(SearchStringEscape=\)"/>

So, does this mean OpenJPA needs a version dependent dictionary
definition for Postgres from now on? Anybody got any better solutions or
care to confirm what I'm seeing?

I've also posted this to the Postgres JDBC mailing list in case they
have any comments.
=======================================================

Andrew

-- 
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc

view thread (6+ messages)  latest in thread

Message-ID: <4E898B0C.5@ahastie.net>
Permalink:  ../4E898B0C.5@ahastie.net/
Also on:    postgresql.org/message-id/4E898B0C.5@ahastie.net

 · 

reply

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: andrew@ahastie.net
  Subject: Re: OpenJPA problems running against PG 8.1
  In-Reply-To: <4E898B0C.5@ahastie.net>
  References: <4E898B0C.5@ahastie.net>

* 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