|
|||||||||||
|
Re: [JDBC] extra rowcopy in ResultSet allways needed ?.
From: Gustav Trede <gustav.trede_wsdevel(at)telia.com>
Date: Wed Feb 20 2008 - 04:21:09 EST
here is diff from current cvs.
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
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;
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;
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;
onInsertRow = false;
}
else
{
! initRowBuffer();
}
onInsertRow = false;
! 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; }
+ 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))
---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq Received on Wed Feb 20 04:27:05 2008 This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:45:02 EDT |
||||||||||
|
|||||||||||