These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: DB2 "with ur" query
PostPosted: Thu Apr 08, 2004 11:10 am 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
Hello,

We use hibernate 2.0.2 on a j2ee project. For performance reasons, our DBA suggests that we append 'with ur' to some specific queries (count(*) that span on multiple tables).

For now, appending 'with ur' to HQL queries fails with hibernate trying to put it in some mapping.

For example, from the following HQL query :

select * from test.className as c where c.property1 = ? and c.property2 = ? with ur


Hibernate executes the following statement on ou DB:

select * from our_table as t where (t.column1 = ?) and (t.column2 = ? with ur)

...which fails...

We tried to add extra parenthesis but without any success :-(

Any idea ?

Thank you in advance.

Xavier.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 9:03 am 
Newbie

Joined: Fri Dec 12, 2003 1:26 pm
Posts: 6
<quote>When working with JDBC or SQLJ at run time: ... <quote>, <quote>Use the setTransactionIsolation method in the java.sql interface connection.<quote>


[url]http://publib.boulder.ibm.com/infocenter/db2help/index.jsp[/url]

Regards
Horia


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 11:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Dirty reads are just evil. This recommendation seems to be common among DB2 DBAs who are used to working with batch-processing systems that use long-running transactions. It is advice that is simply inappropriate for the kind of online, record-oriented systems that Hibernate is usually used for, where transactions are always extremely short.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 12:45 pm 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
It seems however a good recommendation since the sql queries we run are 'select count(*)...' and if the returned number is 290 or 291 does not really matter.

Yet, performance matters a lot, and our DBA believes that these queries should be 'dirty' in order to avoid an averall performance decrease.

Finally, we still want to use hibernate as it already holds all our database mapping.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 20, 2004 6:28 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
OK, if its just for one of two aggregate queries, thats fine. Simply change the JDBC isolation level to uncommitted read. note, however, that even in read committed isolation, read locks are always momentary, they do not even last the length of the transaction, so it really should make very, very little difference to performance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 22, 2004 12:10 pm 
Newbie

Joined: Thu Dec 18, 2003 4:13 am
Posts: 19
seven wrote:
<quote>When working with JDBC or SQLJ at run time: ... <quote>, <quote>Use the setTransactionIsolation method in the java.sql interface connection.<quote>


http://publib.boulder.ibm.com/infocenter/db2help/index.jsp

Regards
Horia


Thanks a lot ! It worked very well and I was able to verify it with an event monitor.


Top
 Profile  
 
 Post subject: Re: DB2 "with ur" query
PostPosted: Thu Jun 04, 2009 5:27 pm 
Newbie

Joined: Thu Jun 04, 2009 5:24 pm
Posts: 1
Hi,
Do you mean "with ur" and Connection.TRANSACTION_READ_UNCOMMITTED both are same?
thanks
Rajesh


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.