openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Curtis (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2426) LIKE operator fails with Postgresql v 9.1
Date Thu, 05 Sep 2013 13:52:52 GMT


Rick Curtis commented on OPENJPA-2426:

I'm somewhat confused. It seems that you opened this JIRA because you can't get a query using
LIKE to work, but you're also having problems executing a simple query also? If that is the
case, lets start out by looking at the simple query. What happens when you execute the query?
If nothing happens, you could try to enable trace[1] to see if that sheds any light on what
is going on.


<property name="openjpa.Log" value="DefaultLevel=trace"/> 
<property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true"/>
 <!-- This property enables tracing of SQL parameters -->
> LIKE operator fails with Postgresql v 9.1
> -----------------------------------------
>                 Key: OPENJPA-2426
>                 URL:
>             Project: OpenJPA
>          Issue Type: Question
>          Components: jpa
>    Affects Versions: 2.2.2
>         Environment: Apache Karaf v 2.3.2 and Aries JPA
>            Reporter: Glenn Silverman
>              Labels: Aries, JPA
> I'm getting very discouraged with OpenJPA as it relates to Postgresql v 9.1 and and creating
queries using the LIKE operator.  I know there was an issue a few years back,,
but I've tried everything mentioned there as a workaround to get a simple query like this
to work:
> Query query = em.createQuery("SELECT p FROM Patient p where p.lastname = :lastname");
> 		query.setParameter("lastname", "Silver");		
> List<Patient> patients = query.getResultList();
> I've tried different property settings in my persistence.xml:
> <property name="openjpa.jdbc.DBDictionary" value="postgres"/>  
> and this:
> <property name="openjpa.jdbc.DBDictionary" value="postgres(SearchStringEscape=\)"/>

> and even this:
> <property name="openjpa.jdbc.DBDictionary" value="postgresRequiresSearchStringEscapeForLike=false)"/>

> Nothing works. I'm not even convinced Aries JPA, the environment I'm running in under
Karaf, even recognizes these property settings.
> When I use Hibernate as my persistence provider, I don't have this problem.  I don't
want to give up on OpenJPA in my OSGi environment, but I may have to if no one has a solution.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message