Changeset 339
- Timestamp:
- 04/22/02 14:57:50 (10 years ago)
- Location:
- branches/release-0_71-bugfixes/Rapla
- Files:
-
- 6 modified
-
INSTALL.txt (modified) (5 diffs)
-
build.xml (modified) (13 diffs)
-
src/org/rapla/storage/dbsql/DBOperator.java (modified) (5 diffs)
-
src/org/rapla/storage/dbsql/EntityStorage.java (modified) (5 diffs)
-
src/org/rapla/storage/dbsql/LinkStorage.java (modified) (2 diffs)
-
src/org/rapla/storage/dbsql/RaplaSQL.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0_71-bugfixes/Rapla/INSTALL.txt
r335 r339 1 This is the INSTALLING-GUIDE for the Rapla-BINARY-DISTRIBUTION, 2 if you have downloaded the SOURCE-DISTRIBUTION you have to 3 !! BUILD A BINARY-DISTRIBUTION first !! For more information read README.txt. 1 This is the INSTALLING-GUIDE for the Rapla-Binary-Distribution, if you have downloaded the 2 source-distribution read README.txt first. 4 3 5 4 Requirements: 6 5 - JDK 1.2.2 (1.3 recommended) 7 8 - For multi-user support: MySQL or PostgreSQL (may work with other SQL-DBs 9 but has not been tested yet. put the driver in your lib directory 10 and configure rapla.properties and the Batch-Scripts start.sh, 11 start.bat) 6 - MySQL or PostgreSQL (may work with other SQL-DBs but has not been tested yet. 7 put the driver in your lib directory and configure rapla.properties 8 and the Batch-Scripts start.sh, start.bat) 12 9 13 10 If you only want to test the Rapla-Functionaliy and don't want to … … 23 20 some appropriate values. 24 21 25 A)Create Mysql DB:22 Create Mysql DB: 26 23 27 24 1. Create a new Database. You can do this in the mysql client with 28 the following Command CREATE DATABASE your_db_name; 29 (Note: If you need full UNICODE-Support you are better of 30 with Postgres). 25 the following Command CREATE DATABASE your_db_name; 31 26 32 27 2. To create the Schema, you have to dump the rapladb.sql file into … … 56 51 57 52 58 B)Create PostgreSQL DB:53 Create PostgreSQL DB: 59 54 60 55 1. First you have to login as postgres user. 61 56 Then you can create a new database with 62 createdb your_db_name -E UNICODE 63 (Note: We strongly recommend using UNICODE as encoding for your database. 64 If your postgres-version doesn't support unicode you might try your 65 local encoding e.g. LATIN_1) 66 67 And also a new user with 68 createuser db_user -P 57 createdb your_db_name -E LATIN1 58 (Note: Currently only the LATIN1 encoding is tested in 59 combination with Rapla.) 69 60 70 61 2. To create the Schema, you have to dump the rapladb.sql file into … … 99 90 To fill the database with the the sample-values you can 100 91 import the data.xml with the following command: 101 start.sh rapla.propertiesxml2sql (UNIX)102 start.bat rapla.propertiesxml2sql (WINDOWS)92 start.sh xml2sql (UNIX) 93 start.bat xml2sql (WINDOWS) 103 94 Warning: All the data in your_db_name will be lost. 104 95 … … 121 112 STARTING RAPLA: 122 113 123 If the .jar extension is associated to you JavaRuntimeEnviroment you 124 can double-click on the rapla.jar (rapla.jar is located in the lib 125 subfolder of your binary-distribution) 114 If the .jar extension is associated to you JRE you can 115 double-click on the rapla.jar. 126 116 127 117 To start Rapla from the command-line, you 128 have to set java in your PATH (if its not al ready there),118 have to set java in your PATH (if its not allready there), 129 119 Example: 130 120 setenv PATH $PATH:/usr/local/java/bin (Unix) -
branches/release-0_71-bugfixes/Rapla/build.xml
r335 r339 83 83 84 84 <!-- Rapla build-file 85 Copyright (C) 2001 -2002Christopher Kohlhaas85 Copyright (C) 2001 Christopher Kohlhaas 86 86 87 87 This programm is free software; you can redistribute it and/or modify … … 109 109 <property name="bin-lib0" value="${main.lib}" /> 110 110 <property name="bin-lib1" value="crimson.jar"/> 111 <property name="bin-lib2" value="jing.jar"/> 112 <property name="bin-lib3" value="saxon.jar"/> 113 <!--property name="bin-lib2" value="mm.mysql-2.0.8-bin.jar"/--> 111 <property name="bin-lib2" value="mm.mysql-2.0.8-bin.jar"/> 114 112 <property name="bin-lib3" value="jdbc7.1-1.2.jar"/> 115 113 … … 143 141 144 142 <property name="name" value="rapla"/> 145 <property name="version" value="0. 8dev"/>146 <property name="year" value="2000-200 2"/>143 <property name="version" value="0.71"/> 144 <property name="year" value="2000-2001"/> 147 145 <property name="copyright" value="Rapla Team"/> 148 146 … … 153 151 <property name="deprecation" value="on"/> 154 152 <property name="verbose" value="no"/> 155 <property name="packages" value="org. *"/>153 <property name="packages" value="org.rapla.*"/> 156 154 157 155 <!-- The rapla-directories --> … … 202 200 <property name="libs-win" value=".\lib\${bin-lib0};.\lib\${bin-lib1};.\lib\${bin-lib2};.\lib\${bin-lib3}"/> 203 201 <property name="libs-applet" value="${bin-lib0},${bin-lib1},${bin-lib2},${bin-lib3}"/> 204 <property name="libs-jar" value="${bin-lib0} ${bin-lib1} ${bin-lib2} ${bin-lib3}../"/>202 <property name="libs-jar" value="${bin-lib0} ${bin-lib1} ../"/> 205 203 <!-- This complex Property is for the rapla.jnpl file --> 206 204 <property name="lib_jnlp_0" value="<jar href="${bin-lib0}"/>"/> … … 255 253 <classpath refid="classpath"/> 256 254 <exclude name="**/RaplaResources*.java" /> 257 < exclude name="**/PrintServicePrinter.java" />255 <!--exclude name="**/dbsql/*.java" /--> 258 256 </javac> 259 <!-- The gifs ,license,xsl and rng filesmust be in the correct classpath -->257 <!-- The gifs must be in the correct classpath --> 260 258 <copy todir="${build.dest}"> 261 259 <fileset dir="${src.dir}"> 262 <include name="**/images/*"/> 263 <include name="**/dbfile/*.xsl"/> 264 <include name="**/dbfile/*.rng"/> 265 </fileset> 266 </copy> 260 <include name="**/*.gif"/> 261 </fileset> 262 </copy> 267 263 </target> 268 264 … … 314 310 <fileset dir="${build.dir}/classes"> 315 311 <include name="**/*.class" /> 316 <include name="**/*.xsl" /> 317 <include name="**/*.rng" /> 318 <include name="**/images/*" /> 312 <include name="**/*.gif" /> 319 313 </fileset> 320 314 </jar> … … 347 341 <mapper type="glob" from="template_*" to="start.*"/> 348 342 </copy> 349 350 <fixcrlf srcdir="${dist-bin.dir}" eol="crlf">351 <include name="*.bat" />352 </fixcrlf>353 343 354 344 <copy todir="${dist-bin.dir}" > … … 368 358 </fileset> 369 359 </chmod> 370 </target>371 372 <target name="start" depends="compile,compile-resources"373 description="Use this during development to quick-launch rapla.">374 <copy todir="${test.dir}">375 <fileset dir="${main.dir}">376 <include name="rapla.properties" />377 <include name="data.xml" />378 </fileset>379 </copy>380 <java classname="${start.class}"381 failonerror="yes"382 fork="no"383 dir="${main.dir}">384 <classpath>385 <pathelement path="${build.dest}" />386 <fileset dir="${main.dir}/lib">387 <patternset refid="bin-libraries" />388 <include name="gnujpdf.jar"/>389 <include name="${main.lib}"/>390 </fileset>391 </classpath>392 <arg value="-c"/>393 <arg value="${test.dir}/rapla.properties"/>394 <arg value="build-script"/>395 </java>396 360 </target> 397 361 … … 407 371 </fileset> 408 372 </classpath> 409 <arg value="-c"/>410 <arg value="rapla.properties"/>411 373 </java> 412 374 </target> … … 536 498 <exclude name="CVS" /> 537 499 <exclude name="xalan*.jar" /> 500 <exclude name="saxon*.jar" /> 538 501 </fileset> 539 502 </copy> … … 770 733 771 734 <!-- =================================================================== --> 772 <!-- Rebuilds website, javadocs, but not the applet-->773 <!-- =================================================================== --> 774 775 <target name="rebuild-site" depends="clean,javadocs, site"776 description="Rebuild the complete site ">735 <!-- Rebuilds website, includes tarballs,javadocs, but not the applet --> 736 <!-- =================================================================== --> 737 738 <target name="rebuild-site" depends="clean,javadocs,cleansite,site" 739 description="Rebuild the complete site (very long)"> 777 740 <mkdir dir="${website.dir}/doc/javadocs"/> 778 741 <mkdir dir="${website.dir}/download"/> 742 <mkdir dir="${website.dir}/demo"/> 779 743 <copy todir="${website.dir}/doc/javadocs"> 780 744 <fileset dir="${build.dir}/javadocs"/> 745 </copy> 746 <copy todir="${website.dir}/download"> 747 <fileset dir="${dist.dir}"> 748 <include name="*.zip"/> 749 <include name="*.tar.gz"/> 750 </fileset> 751 </copy> 752 <copy todir="${website.dir}/demo"> 753 <fileset dir="${dist-webapp.dir}"/> 781 754 </copy> 782 755 </target> … … 925 898 <include name="**/*Test.class" /> 926 899 <exclude name="**/storage/dbsql/*.class" /> 927 <exclude name="**/storage/dbfile/*.class" />928 900 <exclude name="**/AllTest.class" /> 929 901 <exclude name="**/*$$*Test.class" /> -
branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/DBOperator.java
r283 r339 85 85 Connection con = null; 86 86 Connection idcon = null; 87 boolean bAutoCommit = true; 87 88 boolean bFailed = true; 88 89 try { … … 90 91 con = openConnection(); 91 92 idcon = openConnection(); 92 con.setAutoCommit(false); 93 try { 94 con.setAutoCommit(false); 95 // Check if autocommit is disabled (Transaction Support) 96 bAutoCommit = con.getAutoCommit(); 97 } catch (SQLException ex) { 98 config.getLog().log(3,"No Transaction support"); 99 } 93 100 for (int i=0;i<obj.length;i++) 94 101 raplaSQL.store(con,idcon,obj[i]); … … 96 103 bFailed = false; 97 104 } finally { 98 if (bFailed && (con != null) ) {105 if (bFailed && (con != null) && !bAutoCommit) { 99 106 con.rollback(); 100 107 config.getLog().log(4,"Doing rollback"); 101 108 } 102 if (!bFailed && (con != null) ) {109 if (!bFailed && (con != null) && !bAutoCommit) { 103 110 con.commit(); 104 111 config.getLog().log(4,"Commiting"); … … 117 124 checkNoDependencies(obj); 118 125 Connection con = null; 126 boolean bAutoCommit = true; 119 127 boolean bFailed = true; 120 128 try { 121 129 try { 122 130 con = openConnection(); 123 con.setAutoCommit(false); 131 try { 132 con.setAutoCommit(false); 133 // Check if autocommit is disabled 134 bAutoCommit = con.getAutoCommit(); 135 } catch (SQLException ex) { 136 config.getLog().log(3,"No Transaction support"); 137 } 124 138 for (int i=0;i<obj.length;i++) { 125 139 raplaSQL.remove(con,obj[i]); … … 128 142 bFailed = false; 129 143 } finally { 130 if (bFailed && (con != null) ) {144 if (bFailed && (con != null) && !bAutoCommit) { 131 145 con.rollback(); 132 146 config.getLog().log(4,"Doing rollback"); 133 147 } 134 if (!bFailed && (con != null) ) {148 if (!bFailed && (con != null) && !bAutoCommit) { 135 149 con.commit(); 136 150 config.getLog().log(4,"Commiting"); -
branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/EntityStorage.java
r285 r339 195 195 PreparedStatement stmt = null; 196 196 try { 197 if ( config.getLog().enabled(6)) { 198 config.getLog().log(6," Executing SQL: " + sql 199 + " {" + id + "}"); 200 } 197 201 stmt = con.prepareStatement(sql); 198 202 stmt.setInt(1,id.intValue()); … … 272 276 try { 273 277 stmt = idcon.prepareStatement(updateIdSql); 278 if ( config.getLog().enabled(7)) { 279 config.getLog().log(7," Requesting ID: " + updateIdSql 280 + "{" + requestedIds + "},{" + sessionId + "}" ); 281 } 274 282 stmt.setInt(1,requestedIds); 275 283 stmt.setInt(2,sessionId); … … 383 391 entity.setId(requestId(1)); 384 392 stmt = con.prepareStatement(insertSql); 393 if ( config.getLog().enabled(7)) { 394 config.getLog().log(7," Preparing sql-insert: " + insertSql ); 395 } 385 396 } else { 386 397 String query = updateSql; 387 398 stmt = con.prepareStatement(query); 388 stmt.setInt(count(query,'?'),(entity.getId().intValue())); 399 int id = entity.getId().intValue(); 400 if ( config.getLog().enabled(7)) { 401 config.getLog().log(7," Preparing sql-update: " + updateSql 402 + "{" + id + "}"); 403 } 404 stmt.setInt(count(query,'?'),id); 389 405 } 390 406 write(stmt, entity); … … 397 413 public void delete(Entity entity) throws SQLException { 398 414 checkOldSchema(); 415 /* Serious BUG in Version 0.71 399 416 Iterator it = subStores.iterator(); 400 417 while (it.hasNext()) { 401 418 ((Storage) it.next()).deleteAll(); 402 419 } 403 420 */ 404 421 PreparedStatement stmt = null; 405 422 try { … … 407 424 return; 408 425 stmt = con.prepareStatement(deleteSql); 409 stmt.setInt(1,entity.getId().intValue()); 426 int id = entity.getId().intValue(); 427 stmt.setInt(1,id); 428 if ( config.getLog().enabled(7)) { 429 config.getLog().log(7," Executing sql-delete: " + deleteSql 430 + "{" + id + "}"); 431 } 410 432 stmt.executeUpdate(); 411 433 } finally { -
branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/LinkStorage.java
r283 r339 78 78 79 79 void delete(Integer leftId) throws SQLException { 80 int id = leftId.intValue(); 81 if (config.getLog().enabled(6)) { 82 config.getLog().log(6,"Executing delete-sql " + delete 83 + " {" + id + "}"); 84 } 80 85 PreparedStatement stmt = null; 81 86 try { 82 87 stmt = con.prepareStatement(delete); 83 stmt.setInt(1, leftId.intValue());88 stmt.setInt(1,id); 84 89 stmt.executeUpdate(); 85 90 } finally { … … 90 95 91 96 public void deleteAll() throws SQLException { 97 config.getLog().log(3,"Executing DeleteAll SQL: " + deleteAll); 92 98 EntityStorage.executeBatchedStatement(con,deleteAll); 93 99 } -
branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/RaplaSQL.java
r289 r339 456 456 457 457 public void delete(Entity entity) throws SQLException { 458 if ( config.getLog().enabled(4)) 459 config.getLog().log(4," Deleting Reservation with id: " + entity.getId()); 458 460 reservationPerson.delete(entity.getId()); 459 461 allocationStorage.delete(entity.getId()); … … 559 561 stmt.close(); 560 562 } 563 if ( config.getLog().enabled(5)) 564 config.getLog().log(5," Deleting Allocations for Reservation with id: " + reservationId); 561 565 execute("DELETE FROM TERMIN WHERE RESERVID = ?",reservationId); 562 566 }
![(please configure the [header_logo] section in trac.ini)](/chrome/site/rapla.jpg)