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

Change:

>> if ( !(this.shouldUseRownumFiltering()) || ( !(max>0) && !(firstRow>0) )
>> ){
>>            super.printSQLSelectStatement(call, printer, statement);
>>            return;
>>}

To:
if ( !(this.shouldUseRownumFiltering()) || ( !(max>0) && !(firstRow>0) ) ){
            super.printSQLSelectStatement(call, printer, statement);
            printer.printString(" WITH UR");
            return;
}


Zarar Siddiqi wrote:
> 
> Thanks.
> 
> 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().
> 
> Thanks,
> Zarar
> 
> 
> 
> 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
>> > SELECT
>> > 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
>> >
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Appending-WITH-UR-to-non-native-queries-tp28482017p28599687.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top