Mail Archive Home | enhydra List | March 2007 Index
| <-- Date Index --> | <-- Thread Index --> |
Hello. It has been sometime since my last email. :) I bring some bug fixes to share: 1) QueryBuilder.executeUpdate() does not work as expected. This method invokes QueryBuilder.executeUpdate(DBConnection dbConn) passing a null value. What happens in this case, is that the query will never be committed. If you are lucky, after the connection is put back in the connection pool, it will picked up sooner or later and a new query will eventually commit your data, or not... As a workaround, we used QueryBuilder.executeUpdate(DBConnection dbConn) instead of QueryBuilder.executeUpdate() and we managed the connection so we could ensure that the data were commited before the connect went back to the pool. We made a patch to this at work that just adds a commit in the rigth place. The class variable "conn " is never really needed in the executeUpdate(DBConnection dbConn) method so we changed it to be a local method variable and cleaned unused/buggy code in the reset() method. Please see attached diff. 2) The driver property UsePrefixWithUpdate is not used in QueryBuilder.addUpdateSQL(RDBColumn column, String sqlValue). The UsePrefixWithUpdate was introduced to allow that the update query could be generated using simple column name or full column name with <table>.<column>. This is important because postgresql does not support the full column name in update set clause. I don't now why other rdbm support this format as it looks not compliant with SQL92 but it's ok to me. The method QueryBuilder.addUpdateColumn(RDBColumn column, Object value) already supports switching between using or not the prefix as configured by dirver property but the QueryBuilder.addUpdateSQL(RDBColumn column, String sqlValue) does not. We made a patch to correct this and make the method addUpdateSQL(RDBColumn column, String sqlValue) behave accordingly with the UsePrefixWithUpdate driver property. Please see attached diff. 3) Timestamp data type. Since the first enhydra version the java.sql.Timestamp always was mapped to Postgresql Timestamp data type that was equivalent "timestamp with time zone". But starting from Postgresql version 7.3 the timestamp data type changed to "timestamp without time zone". To put back the default behaviour, can you set the default db type for Postgresql to "timestamp with time zone" for the java.sql.Timestamp instead of "timestamp" in the PostgresqlConf.xml? If you use the diff please refer also Gabriel Campos. :) Best regards. João Paulo Ribeiro -- João Paulo Ribeiro | Senior Software Engineer jp@xxxxxxxxxxxx PHONE: + 351 253 305 250 FAX : + 351 253 305 250 www.mobicomp.com ________________________________________________________________ About Solutions | Wireless World CONFIDENTIALITY NOTICE: This message, as well as existing attached files, is confidential and intended exclusively for the individual(s) named as addressees. If you are not the intended recipient, you are kindly requested not to make any use whatsoever of its contents and to proceed to the destruction of the message, thereby notifying the sender. DISCLAIMER: The sender of this message can not ensure the security of its electronic transmission and consequently does not accept liability for any fact which may interfere with the integrity of its content.
2564,2567d2563
< if (null != conn) { // if this class created the connection,
close it.
< conn.close();
< }
< conn = null;
2638d2633
< private DBConnection conn = null; // for execution of stmt
2714c2709,2713
< addUpdateSQL(column.getFullColumnName(), sqlValue);
---
> if(usePrefixWithUpdate){
> addUpdateSQL(column.getFullColumnName(), sqlValue);
> } else {
> addUpdateSQL(column.getColumnName(), sqlValue);
> }
2736c2735
<
---
> DBConnection conn = null;
2748a2748,2750
> if (conn != null) {
> conn.commit();
> }
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.