If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > JVMs reading different data.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-13-11, 09:57
Rajesh1203 Rajesh1203 is offline
Registered User
 
Join Date: Aug 2010
Posts: 38
JVMs reading different data.

Hello All,
Is there anythign equivalent to SQL Server clauses READPAST and UPDTLOCK in DB2?

Actually what I need is:
THere are two JVMs and both fires the same query at the same time and the same database but the records that first JVM fetches should be different from the second one. Means,if first JVM fetches rows 1,2,3,4 and 5 from a table with 10 rows,second JVM should bring me the other 5 rows.

There should be minimal delay. Please suggest if you have an alternative.

Thanks in Advance.
Reply With Quote
  #2 (permalink)  
Old 10-13-11, 18:05
Rajesh1203 Rajesh1203 is offline
Registered User
 
Join Date: Aug 2010
Posts: 38
found the solution,posting it here to help others:

Use the following clause at the end of select statement:
SKIP LOCKED DATA.

SELECT COUNT (*)
FROM TABLE
WHERE FNAME >= ’AAA’
SKIP LOCKED DATA;

This works for DB2 ZOS no idea about LUW.
Reply With Quote
  #3 (permalink)  
Old 10-13-11, 20:40
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
If you want to include locked data without waiting for locks to release:

SELECT COUNT (*)
FROM TABLE
WHERE FNAME >= ’AAA’
WITH UR;
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On