calvinkrishy
calvinkrishy

Reputation: 3928

Informix enabling bulk insert

Enabling bulk insert in the Informix involves setting the environment variable IFX_USEPUT to the value 1 (the default value is 0). When used from a server side JDBC driver this has to be set in the JDBC URL. What are the implications of turning it on for all connections (for example configuring a connection pool where all the connections have this property set to 1)?

In other words, why is the property turned off by default?

Upvotes: 1

Views: 699

Answers (1)

Brian Hughes
Brian Hughes

Reputation: 683

IFX_USEPUT is off by default because of a few implications in how it speeds up batched inserts. It enables faster insertion by skipping server side data validation. This in turn means that if you attempt to insert say a double, into what the database has stored as an integer, your data will most likely end up incorrect in the database.

As long as you match your data types correctly setInt, setDate, etc to the database schema this is safe. Later versions of the JDBC driver also have better client side checks to ensure you don't corrupt the data by accident. It's just not at the point one would enable it by default.

Upvotes: 1

Related Questions