Patch Available to Disable Auto-generatedkeys in Datasources (ColdFusion 8.0, 8.0.1)Products affected
Issue
Adobe ColdFusion 8 added the ability to return the newly created primary key when doing an INSERT statement. The autogenerated key is made available as part of Cfquery's result structure. Some customers have seen the following error logged:
java.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Auto-generated keys were not requested, or the SQL was not a simple INSERT statement.
Other customers have noted an increase in database load due to this feature. This update will allow you to disable autogenerated keys on a per datasource basis. Note that not all datasource types support auto-generated keys. This support is not in postgres or 'MS Access for Unicode' datasources.
Solution
ColdFusion 8.0
Use the ColdFusion 8 Administrator to install the hot fix jar. The installation process is the same for all platforms and installation choices.
- Download hf800-71331.zip (19K) and extract the hf800-71331.jar file.
- Open the ColdFusion 8 Administrator and select the System Information page.
- Click Browse next to the Update File box, and then browse to the extracted file. Select the file, and then click Submit.
- Restart ColdFusion.
You do not need to keep the ColdFusion 8.0 hot fix JAR file after installing it with the ColdFusion Administrator. The file has been copied to the correct location.
The ColdFusion 8.0 hot fix JAR file will appear as a new entry in the System Information list.
Note: Uninstall hot fixes by stopping the ColdFusion Application Server and deleting the hot fix jar file from cf_root/lib/updates directory.
Normally the support for autogenerated keys are turned on and, if the user has to turn off the autogenerated keys support for certain datasources, then the user has to append the following entry in java.args:
-Dcoldfusion.noautogenkeydsns={comma separated list of datasources for which the autogenerated keys support should be turned off}
The java arguments can be updated directly in the jvm.config file. This file is located in ColdFusion8/runtime/bin for ColdFusion server installations. It is located in JRun4/bin for multiserver installations. Always create a backup of the jvm.config file before making changes. Be aware that java arguments are case-sensitive and are separated by spaces.
The java arguments can also be updated directly in the ColdFusion administrator Java and JVM page for server installations. Multi-server and J2EE installations do not have this administrator page and must edit the jvm.config directly. ColdFusion 8 application server must be restarted after changing any java settings.
ColdFusion 8.0.1
ColdFusion 8.0.1 already has the updated code that allows you to disable the auto-generated keys feature for specific datasources. All that is required is to modify your java arguments as described below.
Normally the support for autogenerated keys are turned on and if the user has to turn off the autogenerated keys support for certain datasources, then the user has to append the following entry in java.args:
-Dcoldfusion.noautogenkeydsns={comma separated list of datasources for which the autogenerated keys support should be turned off}
The java arguments can be updated directly in the jvm.config file. This file is located in ColdFusion8/runtime/bin for ColdFusion server installations. It is located in JRun4/bin for multiserver installations. Always create a backup of the jvm.config file before making changes. Be aware that java arguments are case-sensitive and are separated by spaces.
The java arguments can also be updated directly in the ColdFusion administrator Java and JVM page for server installations. Multi-server and J2EE installations do not have this administrator page and must edit the jvm.config directly. ColdFusion 8 application server must be restarted after changing any java settings.
Additional Information
Doc ID
(kb403432)
Last updated
2008-05-01
Products affected
