| From: | Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com> | 
|---|---|
| To: | Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com> | 
| Cc: | PostgreSQL-JDBC <pgsql-jdbc(at)postgresql(dot)org> | 
| Subject: | Re: Bug in org.postgresql.Connection | 
| Date: | 2001-12-07 23:05:53 | 
| Message-ID: | 1007766353.30152.5.camel@osti.knowledgenet.corp | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-jdbc | 
Ugh, sorry. My email didn't make sense, as I read it.  I should know
better than trying to communicate late on a Friday....
The problem is typeOidCache is used in getSQLType(int) rather than
sqlTypeCache.  Diff is here.
[wolpert(at)osti jdbc]$ cvs diff -e org/postgresql/Connection.java
Index: org/postgresql/Connection.java
===================================================================
RCS file:
/projects/cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/Connection.java,v
retrieving revision 1.39
diff -e -r1.39 Connection.java
1106c
                Integer sqlType = (Integer)sqlTypeCache.get(new
Integer(oid));
.
On Fri, 2001-12-07 at 15:39, Ned Wolpert wrote:
> This was right on the tip of my sight, but I missed it in my last email
> message:
> 
> Bug in the method getSQLType(int oid).  It looks for an integer in
>    Integer sqlType = (Integer)typeOidCache.get(iOid);
> But when none found, it does a query to the database to get the value. 
> But it never puts it into the hashtable/cache.  The method does the
> following:
>    sqlTypeCache.put(iOid, sqlType);
>    pgTypeCache.put(iOid, pgType);
> One of two things should happend.  
>   1) change line (1118) from 
>          sqlTypeCache.put(iOid,sqlType);
>      to  
>          typeOidCache.put(iOid,sqlType);
>   
>   or
> 
>   2) add in the line
>          typeOidCache.put(iOid,sqlType);
>      in line 1118
> 
> My question is, that sqlTypeCache is only used here, but typeOidCache is
> used in several places.  Should we remove sqlTypeCache and only use
> typeOidCache or are both needed?
> 
> 
> -- 
> 
> Virtually, 
> Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com>
> 
> D08C2F45:  28E7 56CB 58AC C622 5A51  3C42 8B2B 2739 D08C 2F45 
-- 
Virtually, 
Ned Wolpert <ned(dot)wolpert(at)knowledgenet(dot)com>
D08C2F45:  28E7 56CB 58AC C622 5A51  3C42 8B2B 2739 D08C 2F45 
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Thomas O'Dowd | 2001-12-08 05:40:51 | patch against cvs for getTimestamp() problem. | 
| Previous Message | Ned Wolpert | 2001-12-07 22:39:26 | Bug in org.postgresql.Connection |