IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 4 replies
  • Latest Post - ‏2012-09-12T08:16:59Z by Condor70
Condor70
Condor70
3 Posts

Pinned topic Blocked inserts

‏2012-08-24T14:37:43Z |
Hi,

I need to copy large amounts of data from an external database to DB2 for i.

For this I'm using the native DB2 JDBC driver with "use block insert=true" as specified here:
http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=%2Frzaha%2Fbatchblo.htm

Since this operation is part of a large application that uses a connection pool, all connections will have block insert turned on.

The infocenter lists reasons why block insert isn't turned on by default, but I don't see how any of these reasons is valid if the driver handles the query normally when it doesn't conform to block insert restrictions.

Are there any queries that won't work with block insert turned on?

Thanks, MHA
Updated on 2012-09-12T08:16:59Z at 2012-09-12T08:16:59Z by Condor70
  • krmilligan
    krmilligan
    450 Posts

    Re: Blocked inserts

    ‏2012-09-05T14:48:12Z  
    The block insert property will not have any impact on Select statements.
  • Condor70
    Condor70
    3 Posts

    Re: Blocked inserts

    ‏2012-09-05T15:23:34Z  
    The block insert property will not have any impact on Select statements.
    Thanks for answering.

    Unfortunately the application will do a full range of insert, update, delete, select and call statements. However, none of these statements will be executed in a batch.

    Will "use block insert=true" also not affect non-batched inserts? These inserts do not conform to block insert rules, because the tables contain generated identity fields that are not in the values list.
  • krmilligan
    krmilligan
    450 Posts

    Re: Blocked inserts

    ‏2012-09-05T21:27:20Z  
    • Condor70
    • ‏2012-09-05T15:23:34Z
    Thanks for answering.

    Unfortunately the application will do a full range of insert, update, delete, select and call statements. However, none of these statements will be executed in a batch.

    Will "use block insert=true" also not affect non-batched inserts? These inserts do not conform to block insert rules, because the tables contain generated identity fields that are not in the values list.
    The property does not effect non-batch operations.
  • Condor70
    Condor70
    3 Posts

    Re: Blocked inserts

    ‏2012-09-12T08:16:59Z  
    The property does not effect non-batch operations.
    Thanks, that means it's safe to use in my application.

    ps. I still find it strange that the DB engine can't check if a batched insert statement conforms to the block insert rules and perform a block insert of a standard batch insert accordingly. That way the "use block insert" option could always be enabled.