• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Client/Server Performance, Part 1: Blocking

    June 16, 2010 Michael Sansoterra

    It is no secret that read performance can generally be improved by the age-old “blocking” mechanism whereby many rows are fetched at once in preparation for a program to process them. So how is blocking done in the client/server world? Assuming that the good old IBM i will be the server, the following code samples (C#, Java, VBA, and DRDA) show an example of how to increase the amount of data that can be transferred from the server to the client.

    C# Using ADO.NET and the IBM DB2 UDB for iSeries .NET Provider

    For applications that need to buffer large amounts of data, the iDB2Connection object has properties BlockSize and LobBlockSize (both specified in KB), which can be used to control the buffer size when data is requested. The larger the allocated buffer, the more rows that can be buffered and transferred at once to the client. This is advantageous for performance because it minimizes the number of trips the client needs to make to the server.

    The BlockSize property is used for “normal” data transfers from view and table data while LobBlockSize is used to control the separate buffer storage area that is used for large object data transfers (BLOBs, CLOBs and DBCLOBs.)

    The sample connection string below shows the BlockSize property being set to 512KB.

    iDB2Connection conn = new iDB2Connection(
    "DataSource=as400;UserID=MyUser;Password=MyPwd;Naming=System;
    DefaultCollection=ADVWORKS;BlockSize=512");
    

    For the V6R1 System i Access provider, the BlockSize property defaults to zero (system determined buffer), and the LobBlockSize defaults to 512.

    There is also a DataCompression property that can be used to increase transfer speeds. This property is set to True by default.

    The IBM-supplied ADO.NET provider does not offer an option to block a specific number of rows during a fetch.

    Java Using JDBC and the IBM Toolbox for Java (JTOpen) JDBC Driver

    The IBM Toolbox for Java JDBC Driver has many properties related to performance. A few of them relevant to this discussion are listed in Table 1 below (from IBM):

    Performance
    Property

    Description

    Choices

    Default

    “block criteria“

    Specifies the criteria for
    retrieving data from the server in blocks of records. Specifying a non-zero value
    for this property will reduce the frequency of communication to the server,
    and therefore increase performance.

    Ensure that record blocking is off
    if the cursor is going to be used for subsequent UPDATEs,
    or else the row that is updated will not necessarily be
    the current row.

    “0“ (no record
    blocking)
    “1“ (block if FOR
    FETCH ONLY is specified)
    “2“ (block unless
    FOR UPDATE is specified)

    “2“

    “block size“

    Specifies the block size (in
    kilobytes) to retrieve from the server and cache on the client. This property
    has no effect unless the
    “block criteria“ property is non-zero. Larger block sizes reduce the
    frequency of communication to the server, and therefore may increase
    performance.

    “0“
    “8“
    “16“
    “32“
    “64“
    “128“
    “256“
    “512“

    “32“

    “data compression“

    Specifies whether result set data
    is compressed. If this property is set to
    “true“, then result set data is compressed. If this property is
    set to
    “false“, then result set data is not compressed. Data compression
    may improve performance when retrieving large result sets.

    “true“
    “false“

    “true“

    “lob threshold“

    Specifies the maximum LOB (large
    object) size (in bytes) that can be retrieved as part of a result set. LOBs that are larger than this threshold will be
    retrieved in pieces using extra communication to the server. Larger LOB
    thresholds will reduce the frequency of communication to the server, but will
    download more LOB data, even if it is not used. Smaller LOB thresholds may
    increase frequency of communication to the server, but will only download LOB
    data as it is needed.

    “0“ – “16777216“

    “32768“

     

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Shield Unveils New DR Solution for i/OS The AS/400 at 22: Yesterday and Forever

    Leave a Reply Cancel reply

Volume 10, Number 19 -- June 16, 2010
None

Table of Contents

  • Client/Server Performance, Part 1: Blocking
  • SQL Performance: IN vs. EXISTS
  • How Do I Tell These Partitions Apart?

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • The Power11 Transistor Count Discrepancies Explained – Sort Of
  • Is Your IBM i HA/DR Actually Tested – Or Just Installed?
  • Big Blue Delivers IBM i Customer Requests In ACS Update
  • New DbToo SDK Hooks RPG And Db2 For i To External Services
  • IBM i PTF Guide, Volume 27, Number 33
  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle