[ 
https://issues.apache.org/jira/browse/DERBY-6000?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-6000:
---------------------------------

    Attachment: derby-6000-02-ad-executeLargeUpdateClient.diff

Attaching derby-6000-02-ad-executeLargeUpdateClient.diff. This adds large 
update support to Statements in the client JDBC driver. I am running tests now.

This adds the following method to the embedded driver:

  Statement.getLargeUpdateCount()

...and the following methods to the client driver:

  Statement.executeLargeUpdate( String )
  Statement.executeLargeUpdate( String, int )
  Statement.executeLargeUpdate( String, int[] )
  Statement.executeLargeUpdate( String, String[] )
  Statement.getLargeUpdateCount()

The following changes are made:

1) The update count on the client side is expanded from an int to a long.

2) The update count is passed from the server to the client in the SQLCard 
descriptor. Previously, only an int sized update count was passed. Now a long 
sized update count is passed. This is done by leaving the low order 32 bits of 
the update count in the slot of the SQLCard which was previously used for the 
update count. Then the upper 32 bits are put in a previously unused slot of the 
SQLCard. This should mean that when clients and servers are at different revs, 
the client will still get the correct update count except in cases when the 
update count is greater than Integer.MAX_VALUE. In those oddball cases, the 
client used to receive garbage from the server. The client will continue to 
receive garbage for the update count if the number of updated rows exceeds 
Integer.MAX_VALUE.

3) Magic numbers were eliminated when processing the SQLCard. Hopefully, this 
will make this code easier to study and debug.

4) Factory methods were added for client-side BatchUpdateExceptions. These will 
be expanded when we add support for the new BatchUpdateException constructor 
added by JDBC 4.2.

5) The new methods were added.

6) The engine ResultSet code was tweaked to let tests force the engine to 
return absurdly large update counts. Otherwise, it is practically impossible to 
test the large update methods since this involves generating more than 2 
billion rows for each test case.

7) Tests were added for large updates for both the embedded and client drivers.


Touches the following files:

-----------------------

M       java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
M       java/client/org/apache/derby/client/am/PreparedStatement.java
M       java/client/org/apache/derby/client/am/Agent.java

Changes for (1) and (2).

-----------------------

M       java/client/org/apache/derby/client/net/NetConnectionReply.java
M       java/client/org/apache/derby/client/net/NetCursor.java
M       java/client/org/apache/derby/client/am/Sqlca.java

Changes for (3).

-----------------------

M       java/client/org/apache/derby/client/am/Utils.java
M       java/client/org/apache/derby/client/am/BatchUpdateException.java

Changes for (4).

-----------------------

M       java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
M       java/client/org/apache/derby/client/am/Statement.java
M       java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
M       java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java
M       java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
M       java/drda/org/apache/derby/impl/drda/DRDAStatement.java
M       java/client/org/apache/derby/client/am/LogicalStatementEntity.java

Changes for (5).

-----------------------

M       java/engine/org/apache/derby/impl/sql/execute/DMLWriteResultSet.java
M       java/engine/org/apache/derby/impl/sql/execute/RowUtil.java

Changes for (6).

-----------------------

M       
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/StatementTest.java
M       
java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/XA40Test.java

Changes for (7).

                
> Implement support for JDBC 4.2
> ------------------------------
>
>                 Key: DERBY-6000
>                 URL: https://issues.apache.org/jira/browse/DERBY-6000
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>            Reporter: Rick Hillegas
>         Attachments: derby-6000-01-aa-executeLargeUpdateEmbedded.diff, 
> derby-6000-02-ad-executeLargeUpdateClient.diff, JDBC_4.2_Changes.html
>
>
> Open JDK 8 will include maintenance rev 4.2 of JDBC. The public discussion of 
> JDBC 4.2 will take place here: http://openjdk.java.net/jeps/170. We will want 
> to build Derby support for JDBC 4.2 after a public spec appears. At this 
> time, it is unclear what Derby release will carry this support.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to