Changeset 339

Show
Ignore:
Timestamp:
04/22/02 14:57:50 (10 years ago)
Author:
team4
Message:

*** empty log message ***

Location:
branches/release-0_71-bugfixes/Rapla
Files:
6 modified

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. 
     1This is the INSTALLING-GUIDE for the Rapla-Binary-Distribution, if you have downloaded the  
     2source-distribution read README.txt first. 
    43 
    54Requirements: 
    65- 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) 
    129 
    1310If you only want to test the Rapla-Functionaliy and don't want to 
     
    2320some appropriate values. 
    2421 
    25 A) Create Mysql DB: 
     22Create Mysql DB: 
    2623 
    27241. 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; 
    3126 
    32272. To create the Schema, you have to dump the rapladb.sql file into  
     
    5651 
    5752 
    58 B) Create PostgreSQL DB: 
     53Create PostgreSQL DB: 
    5954 
    60551. First you have to login as postgres user. 
    6156   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.) 
    6960 
    70612. To create the Schema, you have to dump the rapladb.sql file into  
     
    9990To fill the database with the the sample-values you can  
    10091import the data.xml with the following command:  
    101     start.sh rapla.properties xml2sql  (UNIX) 
    102     start.bat rapla.properties xml2sql (WINDOWS) 
     92    start.sh xml2sql  (UNIX) 
     93    start.bat xml2sql (WINDOWS) 
    10394Warning: All the data in your_db_name will be lost. 
    10495 
     
    121112STARTING RAPLA: 
    122113 
    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) 
     114If the .jar extension is associated to you JRE you can 
     115double-click on the rapla.jar. 
    126116 
    127117To start Rapla from the command-line, you 
    128 have to set java in your PATH (if its not already there),   
     118have to set java in your PATH (if its not allready there),   
    129119Example: 
    130120setenv PATH $PATH:/usr/local/java/bin  (Unix) 
  • branches/release-0_71-bugfixes/Rapla/build.xml

    r335 r339  
    8383 
    8484<!-- Rapla build-file 
    85 Copyright (C) 2001-2002 Christopher Kohlhaas                                   
     85Copyright (C) 2001 Christopher Kohlhaas                                   
    8686                                                                          
    8787This programm is free software; you can redistribute it and/or modify     
     
    109109  <property name="bin-lib0" value="${main.lib}" /> 
    110110  <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"/> 
    114112  <property name="bin-lib3" value="jdbc7.1-1.2.jar"/> 
    115113 
     
    143141 
    144142      <property name="name"     value="rapla"/> 
    145       <property name="version"  value="0.8dev"/> 
    146       <property name="year"     value="2000-2002"/> 
     143      <property name="version"  value="0.71"/> 
     144      <property name="year"     value="2000-2001"/> 
    147145      <property name="copyright"  value="Rapla Team"/> 
    148146 
     
    153151      <property name="deprecation"    value="on"/> 
    154152      <property name="verbose"        value="no"/> 
    155       <property name="packages"       value="org.*"/> 
     153      <property name="packages"       value="org.rapla.*"/> 
    156154 
    157155      <!-- The rapla-directories --> 
     
    202200      <property name="libs-win" value=".\lib\${bin-lib0};.\lib\${bin-lib1};.\lib\${bin-lib2};.\lib\${bin-lib3}"/> 
    203201      <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} ../"/> 
    205203      <!-- This complex Property is for the rapla.jnpl file --> 
    206204      <property name="lib_jnlp_0" value="&lt;jar href=&quot;${bin-lib0}&quot;/&gt;"/> 
     
    255253        <classpath refid="classpath"/> 
    256254        <exclude name="**/RaplaResources*.java" /> 
    257         <exclude name="**/PrintServicePrinter.java" /> 
     255        <!--exclude name="**/dbsql/*.java" /--> 
    258256    </javac> 
    259     <!-- The gifs,license,xsl and rng files must be in the correct classpath  --> 
     257    <!-- The gifs must be in the correct classpath  --> 
    260258    <copy todir="${build.dest}"> 
    261259        <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> 
    267263  </target> 
    268264 
     
    314310         <fileset dir="${build.dir}/classes"> 
    315311            <include name="**/*.class" /> 
    316             <include name="**/*.xsl" /> 
    317             <include name="**/*.rng" /> 
    318             <include name="**/images/*" /> 
     312            <include name="**/*.gif" /> 
    319313         </fileset> 
    320314    </jar>  
     
    347341       <mapper type="glob" from="template_*" to="start.*"/> 
    348342    </copy> 
    349  
    350     <fixcrlf srcdir="${dist-bin.dir}" eol="crlf"> 
    351        <include name="*.bat" /> 
    352     </fixcrlf> 
    353343 
    354344    <copy todir="${dist-bin.dir}" > 
     
    368358          </fileset> 
    369359    </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> 
    396360  </target> 
    397361 
     
    407371          </fileset> 
    408372        </classpath> 
    409         <arg value="-c"/>  
    410         <arg value="rapla.properties"/>  
    411373     </java> 
    412374  </target> 
     
    536498           <exclude name="CVS" /> 
    537499           <exclude name="xalan*.jar" /> 
     500           <exclude name="saxon*.jar" /> 
    538501        </fileset> 
    539502    </copy> 
     
    770733 
    771734 <!-- =================================================================== --> 
    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)"> 
    777740     <mkdir dir="${website.dir}/doc/javadocs"/> 
    778741     <mkdir dir="${website.dir}/download"/> 
     742     <mkdir dir="${website.dir}/demo"/> 
    779743     <copy todir="${website.dir}/doc/javadocs"> 
    780744         <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}"/>  
    781754     </copy> 
    782755  </target> 
     
    925898          <include name="**/*Test.class" /> 
    926899          <exclude name="**/storage/dbsql/*.class" /> 
    927           <exclude name="**/storage/dbfile/*.class" /> 
    928900          <exclude name="**/AllTest.class" /> 
    929901          <exclude name="**/*$$*Test.class" /> 
  • branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/DBOperator.java

    r283 r339  
    8585        Connection con = null; 
    8686        Connection idcon = null; 
     87        boolean bAutoCommit = true; 
    8788        boolean bFailed = true; 
    8889        try { 
     
    9091                con = openConnection(); 
    9192                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                } 
    93100                for (int i=0;i<obj.length;i++)  
    94101                    raplaSQL.store(con,idcon,obj[i]); 
     
    96103                bFailed = false; 
    97104            } finally { 
    98                 if (bFailed && (con != null)) { 
     105                if (bFailed && (con != null) && !bAutoCommit) { 
    99106                    con.rollback(); 
    100107                    config.getLog().log(4,"Doing rollback"); 
    101108                } 
    102                 if (!bFailed && (con != null)) { 
     109                if (!bFailed && (con != null) && !bAutoCommit) { 
    103110                    con.commit(); 
    104111                    config.getLog().log(4,"Commiting"); 
     
    117124        checkNoDependencies(obj); 
    118125        Connection con = null; 
     126        boolean bAutoCommit = true; 
    119127        boolean bFailed = true; 
    120128        try { 
    121129            try { 
    122130                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                } 
    124138                for (int i=0;i<obj.length;i++) { 
    125139                    raplaSQL.remove(con,obj[i]); 
     
    128142                bFailed = false; 
    129143            } finally { 
    130                 if (bFailed && (con != null)) { 
     144                if (bFailed && (con != null) && !bAutoCommit) { 
    131145                    con.rollback(); 
    132146                    config.getLog().log(4,"Doing rollback"); 
    133147                } 
    134                 if (!bFailed && (con != null)) { 
     148                if (!bFailed && (con != null) && !bAutoCommit) { 
    135149                    con.commit(); 
    136150                    config.getLog().log(4,"Commiting"); 
  • branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/EntityStorage.java

    r285 r339  
    195195        PreparedStatement stmt = null; 
    196196        try { 
     197            if ( config.getLog().enabled(6)) { 
     198                config.getLog().log(6,"  Executing SQL: " + sql  
     199                                    + " {" + id + "}"); 
     200            } 
    197201            stmt = con.prepareStatement(sql); 
    198202            stmt.setInt(1,id.intValue()); 
     
    272276        try { 
    273277            stmt = idcon.prepareStatement(updateIdSql); 
     278            if ( config.getLog().enabled(7)) { 
     279                config.getLog().log(7," Requesting ID: " + updateIdSql   
     280                                    + "{" + requestedIds + "},{" + sessionId + "}" ); 
     281            } 
    274282            stmt.setInt(1,requestedIds); 
    275283            stmt.setInt(2,sessionId); 
     
    383391                entity.setId(requestId(1)); 
    384392                stmt = con.prepareStatement(insertSql); 
     393                if ( config.getLog().enabled(7)) { 
     394                    config.getLog().log(7,"  Preparing sql-insert: " + insertSql  ); 
     395                } 
    385396            } else { 
    386397                String query = updateSql; 
    387398                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); 
    389405            } 
    390406            write(stmt, entity); 
     
    397413    public void delete(Entity entity) throws SQLException { 
    398414        checkOldSchema(); 
     415        /* Serious BUG in Version 0.71 
    399416        Iterator it = subStores.iterator(); 
    400417        while (it.hasNext()) { 
    401418            ((Storage) it.next()).deleteAll(); 
    402419        } 
    403  
     420        */ 
    404421        PreparedStatement stmt = null; 
    405422        try { 
     
    407424                return; 
    408425            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            } 
    410432            stmt.executeUpdate(); 
    411433        } finally { 
  • branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/LinkStorage.java

    r283 r339  
    7878 
    7979    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        } 
    8085        PreparedStatement stmt = null; 
    8186        try { 
    8287            stmt = con.prepareStatement(delete); 
    83             stmt.setInt(1,leftId.intValue()); 
     88            stmt.setInt(1,id); 
    8489            stmt.executeUpdate(); 
    8590        } finally { 
     
    9095 
    9196    public void deleteAll() throws SQLException { 
     97        config.getLog().log(3,"Executing DeleteAll SQL: " + deleteAll); 
    9298        EntityStorage.executeBatchedStatement(con,deleteAll); 
    9399    } 
  • branches/release-0_71-bugfixes/Rapla/src/org/rapla/storage/dbsql/RaplaSQL.java

    r289 r339  
    456456 
    457457    public void delete(Entity entity) throws SQLException { 
     458        if ( config.getLog().enabled(4))  
     459            config.getLog().log(4,"  Deleting Reservation with id: " + entity.getId()); 
    458460        reservationPerson.delete(entity.getId()); 
    459461        allocationStorage.delete(entity.getId()); 
     
    559561                stmt.close(); 
    560562        } 
     563        if ( config.getLog().enabled(5))  
     564            config.getLog().log(5,"  Deleting Allocations for Reservation with id: " + reservationId); 
    561565        execute("DELETE FROM TERMIN WHERE RESERVID = ?",reservationId); 
    562566    }