Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Appending WITH UR to non-native queries


Any tips on how to go about doing this.  It's a jungle in there with DatabaseCall, ExpressionSQLPrinter and SQLSelectStatement.

My instincts tell me to try SQLSelectStatement but can't find a suitable method to do an append anywhere.  I see an appendOrderClauseToWriter(), appendGroupByClauseToWriter() etc, but not something which says simply append(). 


On Tue, May 11, 2010 at 9:38 AM, James Sutherland <jamesssss@xxxxxxxxx> wrote:

You can define your own DB2Platform subclass that does this.  You just need
to override the printSQLSelectStatement() method.

You may also wish to measure the performance difference between the two SQL
queries to verify if it really makes any difference.

Zarar Siddiqi wrote:
> Hi,
> We're using DB2 and the DBA here recommended that we use uncommitted reads
> to improve performance.  I have to add "WITH UR" at the end of every
> query.  This isn't a problem from the native queries as I can just add it
> there manually, but for the non-native ones, adding "WITH UR" throws an
> exception since it doesn't understand the keywords.  This makes sense to
> me.
> I was wondering what the best way to go about achieving this is.  Is there
> a
> way to customize the session and perhaps check whether an about-to-be
> executed query is a SELECT and if so, append WITH UR at the end of it?
> Any ideas how to manipulate the SELECT queries to append these two words?
> Thanks,
> --
> Zarar
> _______________________________________________
> eclipselink-users mailing list
> eclipselink-users@xxxxxxxxxxx

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink
Forums: TopLink , EclipseLink
Book: Java Persistence
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

eclipselink-users mailing list

Zarar Siddiqi

Back to the top