Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devel:documentation:systems:dev:scripted-jdbc-connector [2022/08/23 15:35]
apeterova changes in example script to work on Postgres
devel:documentation:systems:dev:scripted-jdbc-connector [2022/08/23 16:10] (current)
apeterova path to the scripts for appliance
Line 9: Line 9:
   * set script path on filesystem (recommended)   * set script path on filesystem (recommended)
   * set an inline script (recommended only for deployments without FS)   * set an inline script (recommended only for deployments without FS)
 +
 +If you run CzechIdM on appliance, you can place the scripts inside /data/volumes/czechidm/data/ folder, create e.g. a folder /data/volumes/czechidm/data/ourSystemScripts. Then the script path configured in CzechIdM will be e.g. /opt/czechidm/data/ourSystemScripts/search.groovy.
  
 Another useful setting is "Reload script on execution" (reloadScriptOnExecution), which mainly helps during the development stage. This option should be turned off in production, because reloading (recompiling) the Groovy scripts takes time and memory. However, when you need to upgrade the script and this option is turned off, then you have to restart IdM, otherwise the new version of the script wouldn't be loaded. Don't turn on the option "Reload script on execution" only temporarily, because it may not preserve the loaded newer version of the script, after you turn the option off again! Another useful setting is "Reload script on execution" (reloadScriptOnExecution), which mainly helps during the development stage. This option should be turned off in production, because reloading (recompiling) the Groovy scripts takes time and memory. However, when you need to upgrade the script and this option is turned off, then you have to restart IdM, otherwise the new version of the script wouldn't be loaded. Don't turn on the option "Reload script on execution" only temporarily, because it may not preserve the loaded newer version of the script, after you turn the option off again!
 +
 +==== Pooling configuration ====
 +
 +We recommed using the [[.:system-mapping#connector_pool_configuration|connector pool]] when connectiong systems with this connector. This will make connecting to the datasource more effective. Also, this connector has a suspected memory leak when compiling groovy scripts repeatedly, which is avoided if connector pooling is enabled and "Reload script on execution" is disabled (see above)
  
 ===== Schema attributes ===== ===== Schema attributes =====
Line 35: Line 41:
 }) })
 return result return result
 +
  
 </code> </code>
Line 66: Line 73:
 def retrieved = sql.firstRow("SELECT * FROM USERS WHERE ID = ? LIMIT 1", [id]) def retrieved = sql.firstRow("SELECT * FROM USERS WHERE ID = ? LIMIT 1", [id])
 println retrieved println retrieved
 +
  
 </code> </code>
  • by apeterova