JDBC url locations in SREE
From PTAGISWiki
The following locations must be updated when changing the JDBC url which SREE uses to do queries.
- ptagis/WEB-INF/db.properties
- sree/WEB-INF/db.properties
- sree/WEB-INF/classes/sree.properties
- scheduler.classpath
- sree/WEB-INF/classes/datasource.xml
- sree/WEB-INF/classes/ptagis/*srt
- grep "jdbc url" *
Also in weblogic data pool and startWeblogic.sh
updating bay and jack to use DAS
The JDBC url and driver class need to be updating to switch from edbc to DAS.
How did it ever work specifying the II instance code when the instance code is C1?
The goal is to wrap all these changes in a single script in order make the maintenance window as small as possible. The text files can be managed with diff/patch, stylereport.srl is jar file which can be copied, modified and then swapped via symlinks.
| file | Before update | After update |
| sree/WEB-INF/db.properties | db.driver=ca.edbc.jdbc.EdbcDriver
db.url=jdbc:edbc://localhost:II7/blueback::ptagis3 | db.driver=com.ingres.jdbc.IngresDriver
db.url=jdbc:ingres://localhost:D27/blueback::ptagis3 |
| ptagis/WEB-INF/db.properties | db.driver=ca.edbc.jdbc.EdbcDriver
db.url=jdbc:edbc://localhost:II7/blueback::ptagis3 | db.driver=com.ingres.jdbc.IngresDriver
db.url=jdbc:ingres://localhost:D27/blueback::ptagis3 |
| sree/WEB-INF/classes/datasource.xml | url="jdbc:edbc://localhost:II7/blueback::ptagis3" driver="ca.edbc.jdbc.EdbcDriver" | url="jdbc:ingres://localhost:D27/blueback::ptagis3" driver="com.ingres.jdbc.IngresDriver" |
| sree/WEB-INF/classes/datasource1.xml | url="jdbc:edbc://localhost:II7/blueback::ptagis3" driver="ca.edbc.jdbc.EdbcDriver" | url="jdbc:ingres://localhost:D27/blueback::ptagis3" driver="com.ingres.jdbc.IngresDriver" |
| sree/WEB-INF/classes/sree.properties | scheduler.classpath=/usr/ingres/ing26/ingres/lib/edbc.jar | scheduler.classpath=/usr/ingres/ing2006r2/ingD2/ingres/lib/edbc.jar:
/usr/ingres/ing2006r2/ingD2/ingres/lib/iijdbc.jar |
| weblogic connection pool url | jdbc:edbc://localhost:II7/blueback::ptagis3 | jdbc:ingres://localhost:D27/blueback::ptagis3 |
| weblogic connection pool classname | ca.edbc.jdbc.EdbcDriver | com.ingres.jdbc.IngresDriver |
| sree/WEB-INF/classes/stylereport.srl/ParameterSheet/OSC_Config_Sheet | url="jdbc:edbc://localhost:II7/blueback::ptagis3" driver="ca.edbc.jdbc.EdbcDriver" | |
| sree/WEB-INF/classes/stylereport.srl/ParameterSheet/OSC_Site_Sheet | url="jdbc:edbc://localhost:II7/blueback::ptagis3" driver="ca.edbc.jdbc.EdbcDriver" | |
| sree/WEB-INF/classes/ptagis/*srt | url="jdbc:edbc://localhost:II7/blueback::ptagis3" driver="ca.edbc.jdbc.EdbcDriver" |
diff and patch
For the individual files which must change, and possibly be rolled back, I have created patch files and then used a bash script to apply or reverse the changes with one command. The script to apply all the changes looks like this:
bash-3.00# cat switch-to-new.sh #!/usr/bin/bash patch <sree-db.patch patch <sreeprop.patch patch <ptagis-db.patch patch <datasource.patch patch <datasource1.patch patch <day.patch patch <osc.patch patch <sitedetdd.patch patch <sitesumdd.patch patch <sitesum.patch patch <sitesumsmp.patch rm ptagis-1.0/web/sree/WEB-INF/classes/stylereport.srl ln -s stylereport.srl20080310 ptagis-1.0/web/sree/WEB-INF/classes/stylereport.srl
And likewise the command to rollback the changes looks like this:
bash-3.00# cat switch-to-old.sh #!/usr/bin/bash patch -R <sree-db.patch patch -R <sreeprop.patch patch -R <ptagis-db.patch patch -R <datasource.patch patch -R <datasource1.patch patch -R <day.patch patch -R <osc.patch patch -R <sitedetdd.patch patch -R <sitesumdd.patch patch -R <sitesum.patch patch -R <sitesumsmp.patch rm ptagis-1.0/web/sree/WEB-INF/classes/stylereport.srl ln -s stylereport.srl20080309 ptagis-1.0/web/sree/WEB-INF/classes/stylereport.srl
The stylereport.srl file (which is really a jar file) had to be treated differently. I created two dated stylereport.srl files so that I could use a symlink to switch between the two. stylereport.srl20080309 is the old version and stylereport.srl20080310 is the version with new jdbc URLs.
When the time comes to apply the new JDBC urls, I can bring down weblogic, apply the changes by running the switch-to-new.sh script, and bring weblogic back up.
If any problems crop up, I can run the switch-to-old.sh to reverse the changes.
This allows for users to make changes that will not be rolled back like they would if I simply used CVS to take a snapshot of the complete configuration and had to rollback that way. Only system files are being patched and rolled back. User-level files will be unaffected.
