Showing posts with label toplink. Show all posts
Showing posts with label toplink. Show all posts

15 December 2010

BUG: Toplink doesn't correctly interpret named queries when you use setMaxResults() and setFirstResult()

Hi folks,

I found some bug in toplink that is shipped with Oracle App Server 10.1.3.4.0 (actually among many bugs!!)

According to JPA1.0 specs, Query.setMaxResults() and Query.setFirstResult() methods doesn't work with only queries that contains FETCH JOIN.

But unfortantely, when I tried these two methods with a normal INNER JOIN query, I got the query being changed and returned invalid results!!

So, beware of this!!!

Workaround:
One workaround is to make the join by equity joining columns.
ex:
select s from Suppliers s, Products p where s.productId = p.productId

23 November 2010

Workaround to find generated SQL on OAS

Al salmo Alykom,

I don't know if this post will be valuable or not, but let me tell you about it.

I am using Toplink as a JPA implementation on OAS from within Eclipse IDE, I am try to show the generated SQL by putting the following property in persistence.xml:

<property name="toplink.logging.level" value="FINE" />


It is supposed to work, but don't for me.

So, I find a workaround to find the generated SQL.
You will find the generated SQL here: "app_serv_home\j2ee\home\log\oc4j\log.xml"

Beware, the file is huge, so try to use a utility to tail the file for you (ex use GNU tail)