On Wed, 09 Feb 2000, you wrote:
> on 2/8/00 6:54 PM, Nissim <[EMAIL PROTECTED]> wrote:
> 
> > It looks like the code is doing this:
> > 
> > if (  user.getPassword().equals(password) )
> > 
> > and getPassword is returning Null.
> > 
> > Is this a problem with some PGSQL stuff?  I'll be glad to help with it
> > if someone points me in the right direction.
> 
> Shoot. I have no idea. You are right that getPassword() seems to be
> returning null, but I have no idea *why*. ;-( This code does work fine with
> MySQL on the Jyve site, so I do know that it works.

        The problem lies within village. The Postgres JDBC driver returns the
Column names in the ResultSetMetaData as in lowercase, causing Turbine to build
the permStorage HashTable in TurbineUserPeer to be filled with lowercase keys.
Then TurbineUser (or some other class, sorry, I'm 200 kilometers away from my
source at this moment) comes around and tries to get a value from the HashTable
with an uppercase key, assuming that the table was filled with uppercase keys,
basing on the perfectly correct assumption that SQL ist mostly
case-insensitive. The next thing you see is the NPE thrown by <...>

        I proposed the following fix to village: (Mail Subject: "Column names
from Metadata")

diff -u -u -r1.3 Column.java
--- com/workingdogs/village/Column.java 1999/11/29 23:15:18     1.3
+++ com/workingdogs/village/Column.java 2000/01/05 15:04:31
@@ -113,7 +113,7 @@
     void populate (ResultSetMetaData rsmd, int colNum) throws SQLException
     {
         this.columnNumber = colNum;
-        this.name = rsmd.getColumnName (columnNumber);
+        this.name = rsmd.getColumnName(columnNumber).toUpperCase();
         this.tableName = rsmd.getTableName(columnNumber);
         this.columnTypeName = rsmd.getColumnTypeName (columnNumber);
         this.columnType = rsmd.getColumnType (columnNumber);

        Brett vetoed the change, proposing that I should fix the database
generating scripts to force Postgres to have uppercase column names.
Unfortunately, this option is turning out to be a major pain, effectively
forcing me to enclose every other column name in quotes.

        This is the biggest stumbling block in my effort to add Postgres support
to Turbine. Maybe we could review Bretts decision or ask the others for their
oppinions?


        Regards,
                Hakan

-- 
Hakan Tandogan                                       [EMAIL PROTECTED]

ICONSULT Tandogan - Egerer GbR                   Tel.: +49-9131-9047-0
Memelstrasse 38 - D-91052 Erlangen               Fax.: +49-9131-9047-77

"Any sufficiently advanced bug is indistinguishable from a feature"


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to