Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id F31DE2E0053 for ; Wed, 20 Feb 2008 05:21:24 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 01898-01 for ; Wed, 20 Feb 2008 05:21:16 -0400 (AST) Received: from av8-2-sn3.vrr.skanova.net (av8-2-sn3.vrr.skanova.net [81.228.9.184]) by postgresql.org (Postfix) with ESMTP id DA9572E0050 for ; Wed, 20 Feb 2008 05:21:19 -0400 (AST) Received: by av8-2-sn3.vrr.skanova.net (Postfix, from userid 502) id BC7A6381A1; Wed, 20 Feb 2008 10:21:17 +0100 (CET) Received: from smtp3-1-sn3.vrr.skanova.net (smtp3-1-sn3.vrr.skanova.net [81.228.9.101]) by av8-2-sn3.vrr.skanova.net (Postfix) with ESMTP id 6DF0837F5E; Wed, 20 Feb 2008 10:21:17 +0100 (CET) Received: from [192.168.1.33] (90-227-182-233-no128.tbcn.telia.com [90.227.182.233]) by smtp3-1-sn3.vrr.skanova.net (Postfix) with ESMTP id DCA6437E57; Wed, 20 Feb 2008 10:21:14 +0100 (CET) Message-ID: <47BBF105.2030808@telia.com> Date: Wed, 20 Feb 2008 10:21:09 +0100 From: Gustav Trede User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc Subject: Re: extra rowcopy in ResultSet allways needed ?. References: <47B6FF78.9010802@telia.com> <47B71107.70302@telia.com> <47B71714.2050202@ejurka.com> <47B7207F.3090006@telia.com> <47B72171.8040103@ejurka.com> In-Reply-To: <47B72171.8040103@ejurka.com> Content-Type: multipart/mixed; boundary="------------070504090906040204090405" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200802/152 X-Sequence-Number: 18359 This is a multi-part message in MIME format. --------------070504090906040204090405 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit here is diff from current cvs. > >> >> I will do it for all methods that is not update methods. >> doing it in one method and then call it. >> >> i just attach the new AbstractJdbc2ResultSet.java in an email or ? >> > > A patch would be better. If you've got cvs checkout, the "cvs diff > -c" is what we'd like to see. > > Also, please keep replies on the list so other people can read/comment > on your emails. > > Kris Jurka > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Have you searched our list archives? > > http://archives.postgresql.org > > __________ Information from ESET NOD32 Antivirus, version of virus > signature database 2880 (20080215) __________ > > The message was checked by ESET NOD32 Antivirus. > > http://www.eset.com > > > --------------070504090906040204090405 Content-Type: text/plain; name="abstrresultset.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="abstrresultset.diff" Index: AbstractJdbc2ResultSet.java =================================================================== RCS file: /cvsroot/jdbc/pgjdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v retrieving revision 1.102 diff -c -r1.102 AbstractJdbc2ResultSet.java *** AbstractJdbc2ResultSet.java 19 Feb 2008 06:12:24 -0000 1.102 --- AbstractJdbc2ResultSet.java 20 Feb 2008 08:08:16 -0000 *************** *** 250,259 **** } current_row = internalIndex; ! this_row = (byte[][]) rows.elementAt(internalIndex); ! ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); onInsertRow = false; return true; --- 250,256 ---- } current_row = internalIndex; ! initRowBuffer(); onInsertRow = false; return true; *************** *** 295,304 **** return false; current_row = 0; ! this_row = (byte[][]) rows.elementAt(current_row); ! ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); onInsertRow = false; return true; --- 292,298 ---- return false; current_row = 0; ! initRowBuffer(); onInsertRow = false; return true; *************** *** 629,638 **** return false; current_row = rows_size - 1; ! this_row = (byte[][]) rows.elementAt(current_row); ! ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); onInsertRow = false; return true; --- 623,629 ---- return false; current_row = rows_size - 1; ! initRowBuffer(); onInsertRow = false; return true; *************** *** 658,666 **** { current_row--; } ! this_row = (byte[][]) rows.elementAt(current_row); ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); return true; } --- 649,655 ---- { current_row--; } ! initRowBuffer(); return true; } *************** *** 877,886 **** } else { ! this_row = (byte[][]) rows.elementAt(current_row); ! ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); } onInsertRow = false; --- 866,872 ---- } else { ! initRowBuffer(); } onInsertRow = false; *************** *** 1858,1867 **** current_row++; } ! this_row = (byte [][])rows.elementAt(current_row); ! ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); return true; } --- 1844,1850 ---- current_row++; } ! initRowBuffer(); return true; } *************** *** 2808,2813 **** --- 2791,2806 ---- return 0; // SQL NULL } + private void initRowBuffer(){ + this_row = (byte[][]) rows.elementAt(current_row); + if (resultsetconcurrency == ResultSet.CONCUR_UPDATABLE) { + rowBuffer = new byte[this_row.length][]; + System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); + }else{ + rowBuffer = this_row; + } + } + private boolean isColumnTrimmable(int columnIndex) throws SQLException { switch (getSQLType(columnIndex)) --------------070504090906040204090405--