JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom JDBC Developer's Guide - Supra - Cincom

10.07.2015 Views

JDBC and multi-threadingThe Cincom ORDB JDBC driver provides support for programs that use multiplethreads.The following files show a simple multithreaded Cincom ORDB JDBC applicationand can be found in the %ORDB%\demo\jdbc\samples directory:♦ threadSample.java♦♦sqlExecuteThread.javasqlResultsThread.javaJDBC Developer's Guide, P25-9504-03 Page 86Chapter: 6. Coding tips and troubleshootingSection: JDBC and multi-threading

Performance optimizationThe following are performance considerations for your Cincom ORDB JDBCapplication:♦ Disable auto-commit mode♦♦♦♦♦The array interfaceAutomatic custom mappingConnection poolingTrapping exceptionsSchema locksDisabling auto-commit modeAuto-commit mode indicates to the database whether to issue a commit afterevery SQL statement, after every Cincom ORDB JDBC Extension that updates adatabase instance or collection, and after every database method invocation.By default, new connection objects are in auto-commit mode. You can controlthe auto-commit mode for a connection with the setAutoCommit() method ofthe java.sql.Connection interface.You can also control the default auto-commit mode for new connections byusing the setAutoCommitDefault() static method of theordbjava.jdbc.ordbDriver class.Commits are expensive operations, and they cause all ResultSets to discardtheir current position.If auto-commit is disabled (recommended), then the JDBC driver groups theconnection’s SQL statements, and other database modifications into atransactions that is terminated by either a commit( ) or rollback( ) statement.JDBC Developer's Guide, P25-9504-03 Page 87Chapter: 6. Coding tips and troubleshootingSection: Performance optimization

Performance optimizationThe following are performance considerations for your <strong>Cincom</strong> ORDB <strong>JDBC</strong>application:♦ Disable auto-commit mode♦♦♦♦♦The array interfaceAutomatic custom mappingConnection poolingTrapping exceptionsSchema locksDisabling auto-commit modeAuto-commit mode indicates to the database whether to issue a commit afterevery SQL statement, after every <strong>Cincom</strong> ORDB <strong>JDBC</strong> Extension that updates adatabase instance or collection, and after every database method invocation.By default, new connection objects are in auto-commit mode. You can controlthe auto-commit mode for a connection with the setAutoCommit() method ofthe java.sql.Connection interface.You can also control the default auto-commit mode for new connections byusing the setAutoCommitDefault() static method of theordbjava.jdbc.ordbDriver class.Commits are expensive operations, and they cause all ResultSets to discardtheir current position.If auto-commit is disabled (recommended), then the <strong>JDBC</strong> driver groups theconnection’s SQL statements, and other database modifications into atransactions that is terminated by either a commit( ) or rollback( ) statement.<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 87Chapter: 6. Coding tips and troubleshootingSection: Performance optimization

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!