The two environment variables OPTOFC and IFX_AUTOFREE can be used to reduce network traffic when you close Statement and ResultSet objects.
Set OPTOFC to 1 to specify that the ResultSet.close() method does not require a network round trip if all the qualifying rows have already been retrieved in the client's tuple buffer. The database server automatically closes the cursor after all the rows have been retrieved.
IBM Informix JDBC Driver might or might not have additional rows in the client's tuple buffer before the next ResultSet.next() method is called. Therefore, unless IBM Informix JDBC Driver has received all rows from the database server, the ResultSet.close() method might still require a network round trip when OPTOFC is set to 1.
Set IFX_AUTOFREE to 1 to specify that the Statement.close() method does not require a network round trip to free the database server cursor resources if the cursor has already been closed in the database server.
You can also use the setAutoFree(boolean flag) and getAutoFree() methods to free database server cursor resources. For more information, see Using the Auto Free Feature.
The database server automatically frees the cursor resources right after the cursor is closed, either explicitly by the ResultSet.close() method or implicitly by the OPTOFC environment variable.
When the cursor resources have been freed, the cursor can no longer be referenced.
For examples of how to use the OPTOFC and IFX_AUTOFREE environment variables, see the autofree.java and optofc.java demonstration examples described in Appendix A. Sample Code Files. In these examples, the variables are set with the Properties.put() method.
For more information on setting Informix environment variables, refer to Using Informix Environment Variables.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]