[jrf-devel] Re: JRF now running with Firebird (and PostgreSQL)...
Brought to you by:
joncrlsn
|
From: Mandip S. S. <ma...@su...> - 2002-03-14 12:19:19
|
Hi Erik Sorry for the delay in getting back to you, have been snowed under lately. There are a couple of topics I need to discuss. Firstly there was the issue of me doing a checkout and not being able to run the tests. In particular when I first run the DomainTEST class I get 22 errors and when I run the test there after I get 10 failures and 7 errors. We've tried a co on David's machine which is running the same version of java and ant, and everything works fine, so I'm not really sure what could be causing the problem. Secondly there is the work I've been doing on making JRF use a Firebird database (and also a PostgreSQL database). I'm happy to report that the work is now finished and I have submitted a patch and also the new FirebirdDatabasePolicy. 22 out of 24 tests in DomainTEST run successfully for the Firebird database and 21 out of 24 run successfully for the PostgreSQL database. The tests 'test030UpdateSequencedKey' and 'test500TimestampOptimisticlocking' fail on the Firebird database due to the fact that the standard Timestamp is only accurate to the nearest seecond. This can be overcome by using the 'getExactTimestamp()' UDF but I haven't had time to look into this yet. The same problem occurs with the PostgreSQL database. Below is a list of the classes I have modified and a brief description of what has been done. 1) source/com/is/jrf/AbstractColumnSpec.java Added a 'String tableName' parameter to the ColumnDefinitionString method because the Firebird database didn't like the NULL token as a default value. The default value can now be specified in the DatabasePolicy. 2) source/com/is/jrf/AbstractDomain.java Changed the createTable method which was creating a new sequence even for a subtype table. Changed the dropTable method so that it now goes to the DatabasePolicy and deletes any generator/sequence associated with the table before actually dropping it. Changed the endTransaction method so that it goes to the DatabasePolicy checks whether the JDBCHelper should be closed. This is true for all databases except Firebird. 3) source/com/is/jrf/ColumnSpec.java This was changed as a consequence of 1). 4) source/com/is/jrf/CompoundPrimaryKeyColumnSpec.java This was changed as a consequence of 1). 5) source/com/is/jrf/CreateTableSQLBuilder.java This was changed as a consequence of 1). 6) source/com/is/jrf/DatabasePolicy.java This was changed to an abstract class for greater flexibility. 7) source/com/is/jrf/HypersonicDatabasePolicy.java This was changed as a consequence of 6). 8) source/com/is/jrf/InstantDBDatabasePolicy.java This was changed as a consequence of 6). 9) source/com/is/jrf/MySQLDatabasePolicy.java This was changed as a consequence of 6). 10) source/com/is/jrf/OracleDatabasePolicy.java This was changed as a consequence of 6). 11) source/com/is/jrf/PostgreSQLDatabasePolicy.java Added the dropTable method to delete any associated sequence. 12) source/com/is/jrf/SQLServerSybaseDatabasePolicy.java This was changed as a consequence of 6). 13) source/test/DomainTEST.java This was changed because creating and dropping tables for every test crashed the Firebird database. Note, this is only a temporary solution. I'm sure you guys will come up with a better way. 14) source/test/EmployeeDomain.java Added a retJDBCHelper method. 15) source/test/ManufacturerDomain.java Added a retJDBCHelper method. 16) source/test/PartDomain.java Added a retJDBCHelper method. 17) source/test/PersonDomain.java Added a retJDBCHelper method. 18) jrf.properties Now includes commented example info to connect to a Firebird database. I would be grateful if you guys could look over the changes and get back to me about anything you don't like or think could be done a better way. Regards Mandip |