Re: Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-12-10 Thread Lance Andersen - Oracle
Hi Frank,

As I explained in one of my earlier emails,  tests that require a database will 
not be added to jtreg.  I have a unit test suite which i use for that but that 
is not external


Best
Lance
On Dec 10, 2012, at 2:44 AM, Frank Ding wrote:

> Hi Lance,
>  The code refactory looks good.  By the way, the newly added unit test is not 
> jtreg test case?
> 
> Best regards,
> Frank
> 
> On 12/5/2012 4:38 AM, Lance Andersen - Oracle wrote:
>> All,
>> 
>> Attached is the patch for:  8004374 based off the issue that Frank reported.
>> 
>> for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/ 
>> 
>> 
>> The TCK, SQE and the JDBC Unit Tests run clean.  I added a new Unit Test to 
>> validate the issue.
>> 
>> Frank, I did not use your fix as I was able to clean the code up a bit more 
>> and get rid of more crud while addressing it.  It is similar though.
>> 
>> Best
>> Lance
>> 
>> 
>> 
>> 
>> 
>> Lance Andersen| 
>> Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> lance.ander...@oracle.com 
>> 
>> 
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com



Re: Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-12-09 Thread Frank Ding

Hi Lance,
  The code refactory looks good.  By the way, the newly added unit test 
is not jtreg test case?


Best regards,
Frank

On 12/5/2012 4:38 AM, Lance Andersen - Oracle wrote:

All,

Attached is the patch for:  8004374 based off the issue that Frank 
reported.


 for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/ 



The TCK, SQE and the JDBC Unit Tests run clean.  I added a new Unit 
Test to validate the issue.


Frank, I did not use your fix as I was able to clean the code up a bit 
more and get rid of more crud while addressing it.  It is similar though.


Best
Lance





Lance 
Andersen| Principal Member of Technical Staff | +1.781.442.2037

Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com 






Review needed: 8004374 : Fwd: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-12-04 Thread Lance Andersen - Oracle
All,

Attached is the patch for:  8004374 based off the issue that Frank reported.

 for http://cr.openjdk.java.net/~lancea/8004374/webrev.00/

The TCK, SQE and the JDBC Unit Tests run clean.  I added a new Unit Test to 
validate the issue.

Frank, I did not use your fix as I was able to clean the code up a bit more and 
get rid of more crud while addressing it.  It is similar though.

Best
Lance


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com


Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-12-03 Thread Lance Andersen - Oracle
I will get to it sometime within the next week.  Have some higher priority 
items to address first

Best
Lance
On Dec 3, 2012, at 3:17 AM, Frank Ding wrote:

> Hi Lance,
>  Thanks for your clarification.  I created the test case you requested and 
> attached it in this email.  Please review it.  By the way, the new Oracle bug 
> (internal id 2376620) submitted by me several days ago seems not having been 
> reviewed.  Could you also help me on this?
> 
> Best regards,
> Frank
> 
> 
> On 11/30/2012 8:40 PM, Lance Andersen - Oracle wrote:
>> Hi Frank,
>> 
>> Thank you for the email.  No we do not want tests that require database 
>> access in jtreg.
>> 
>> What I was trying to say, albeit not probably as clear as it could have been 
>> is that it would be helpful to provide a complete example and to use Java DB 
>> as the database if it is a generic data access issue as while it is not a 
>> required part of the Java SE specification, we do provide it with the Oracle 
>> JDK so it makes it easier to test against for developers vs finding an 
>> instance of DB2, Sybase or even Oracle to test against.
>> 
>> Best
>> Lance
>> On Nov 30, 2012, at 12:26 AM, Frank Ding wrote:
>> 
>>> Hi Lance,
>>>  Sorry for late response and thanks for your comment.  You mean I can write 
>>> a jtreg test case that connects to Java DB?  I can do that.
>>> 
>>> Best regards,
>>> Frank
>>> 
>>> On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote:
 Hi Frank,
 
 
 Thank you for the note
 If you could in the future, please provide  a  complete test program to 
 repro the issue as it would save time with the reviews.  Ideally if the 
 issue is not database specific it would be good to leverage Java DB as it 
 is included within Oracle JDK
 
 I will look at this sometime this week
 
 Best
 Lance
 On Nov 12, 2012, at 9:25 PM, Frank Ding wrote:
 
> Hi Lance
>  Thanks for your quick response.  Please find the bug info below.
> 
>  The problem:
>  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
> conflicts, if any, is reported.  The number of conflicts is the actual 
> number of existing rows in database, which is the size of variable 
> 'status' defined in CachedRowSetWriter.writeData().  It's not the 
> conflict number that is supposed to be.
> 
>  Test case:
>  The bug can be easily manifested in all SQL server environment. Here 
> take PostgreSQL for example.
>  1. The sql script to create a table
> CREATE TABLE ressystem.roomdescription
> (
>  roomdescription_id serial NOT NULL,
>  roomdescription character varying NOT NULL,
>  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
> )
> 
>  2.  Manually insert 3 rows
> (1, "Test 1")
> (2, "Test 2")
> (3, "Test 3")
> 
>  3. Create a Java class that connects the established database and then 
> execute the following code snippet.
> String query = "select roomdescription_id, roomdescription from 
> ressystem.roomdescription";
> Object[] values = {2, "Test2"};
> rs.setCommand(query);
> rs.execute(conn);
> rs.moveToInsertRow();
> for(int i=0; i rs.updateObject(i+1,values[i]);
> }
> rs.insertRow();
> rs.moveToCurrentRow();
> rs.acceptChanges(conn);
> 
>  4. An exception occurs with following output.
> javax.sql.rowset.spi.SyncProviderException: 4conflicts while synchronizing
>at 
> com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412)
>at 
> com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880)
> 
> 5. In fact, there is only one conflicting row but 4 were reported.
> 
> Best regards,
> Frank
> 
> On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote:
>> Frank,
>> 
>> If you can please post the bug info here, I will take a look at your 
>> patch
>> 
>> Best
>> Lance
>> On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:
>> 
>>> Hi guys,
>>>  We discovered a bug in CachedRowSetWriter.writeData method where 
>>> incorrect number of conflicts is reported.  I searched in Oracle bug 
>>> database and no similar record was found.  So I submitted a new one 
>>> whose internal review ID is 2376620.  A test case with code is 
>>> illustrated in the bug submission that leverages PostgreSQL server but 
>>> the issue is platform independent and easy to reproduce.
>>>  I provided a patch review, available @
>>>  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
>>>  Is there anybody who is interested in patch and can also review bug 
>>> 2376620?  Your reply is appreciated.
>>> 
>>> Best regards,
>>> Frank
>>> 
>>> 
>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive

Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-12-03 Thread Frank Ding

Hi Lance,
  Thanks for your clarification.  I created the test case you requested 
and attached it in this email.  Please review it.  By the way, the new 
Oracle bug (internal id 2376620) submitted by me several days ago seems 
not having been reviewed.  Could you also help me on this?


Best regards,
Frank


On 11/30/2012 8:40 PM, Lance Andersen - Oracle wrote:

Hi Frank,

Thank you for the email.  No we do not want tests that require database access 
in jtreg.

What I was trying to say, albeit not probably as clear as it could have been is 
that it would be helpful to provide a complete example and to use Java DB as 
the database if it is a generic data access issue as while it is not a required 
part of the Java SE specification, we do provide it with the Oracle JDK so it 
makes it easier to test against for developers vs finding an instance of DB2, 
Sybase or even Oracle to test against.

Best
Lance
On Nov 30, 2012, at 12:26 AM, Frank Ding wrote:


Hi Lance,
  Sorry for late response and thanks for your comment.  You mean I can write a 
jtreg test case that connects to Java DB?  I can do that.

Best regards,
Frank

On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote:

Hi Frank,


Thank you for the note
If you could in the future, please provide  a  complete test program to repro 
the issue as it would save time with the reviews.  Ideally if the issue is not 
database specific it would be good to leverage Java DB as it is included within 
Oracle JDK

I will look at this sometime this week

Best
Lance
On Nov 12, 2012, at 9:25 PM, Frank Ding wrote:


Hi Lance
  Thanks for your quick response.  Please find the bug info below.

  The problem:
  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
conflicts, if any, is reported.  The number of conflicts is the actual number 
of existing rows in database, which is the size of variable 'status' defined in 
CachedRowSetWriter.writeData().  It's not the conflict number that is supposed 
to be.

  Test case:
  The bug can be easily manifested in all SQL server environment. Here take 
PostgreSQL for example.
  1. The sql script to create a table
CREATE TABLE ressystem.roomdescription
(
  roomdescription_id serial NOT NULL,
  roomdescription character varying NOT NULL,
  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
)

  2.  Manually insert 3 rows
(1, "Test 1")
(2, "Test 2")
(3, "Test 3")

  3. Create a Java class that connects the established database and then 
execute the following code snippet.
String query = "select roomdescription_id, roomdescription from 
ressystem.roomdescription";
Object[] values = {2, "Test2"};
rs.setCommand(query);
rs.execute(conn);
rs.moveToInsertRow();
for(int i=0; i
Frank,

If you can please post the bug info here, I will take a look at your patch

Best
Lance
On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:


Hi guys,
  We discovered a bug in CachedRowSetWriter.writeData method where incorrect 
number of conflicts is reported.  I searched in Oracle bug database and no 
similar record was found.  So I submitted a new one whose internal review ID is 
2376620.  A test case with code is illustrated in the bug submission that 
leverages PostgreSQL server but the issue is platform independent and easy to 
reproduce.
  I provided a patch review, available @
  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
  Is there anybody who is interested in patch and can also review bug 2376620?  
Your reply is appreciated.

Best regards,
Frank



Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com



Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com




Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com



/*
 * Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional in

Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-30 Thread Lance Andersen - Oracle
Hi Frank,

Thank you for the email.  No we do not want tests that require database access 
in jtreg.

What I was trying to say, albeit not probably as clear as it could have been is 
that it would be helpful to provide a complete example and to use Java DB as 
the database if it is a generic data access issue as while it is not a required 
part of the Java SE specification, we do provide it with the Oracle JDK so it 
makes it easier to test against for developers vs finding an instance of DB2, 
Sybase or even Oracle to test against.

Best
Lance
On Nov 30, 2012, at 12:26 AM, Frank Ding wrote:

> Hi Lance,
>  Sorry for late response and thanks for your comment.  You mean I can write a 
> jtreg test case that connects to Java DB?  I can do that.
> 
> Best regards,
> Frank
> 
> On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote:
>> Hi Frank,
>> 
>> 
>> Thank you for the note
>> If you could in the future, please provide  a  complete test program to 
>> repro the issue as it would save time with the reviews.  Ideally if the 
>> issue is not database specific it would be good to leverage Java DB as it is 
>> included within Oracle JDK
>> 
>> I will look at this sometime this week
>> 
>> Best
>> Lance
>> On Nov 12, 2012, at 9:25 PM, Frank Ding wrote:
>> 
>>> Hi Lance
>>>  Thanks for your quick response.  Please find the bug info below.
>>> 
>>>  The problem:
>>>  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
>>> conflicts, if any, is reported.  The number of conflicts is the actual 
>>> number of existing rows in database, which is the size of variable 'status' 
>>> defined in CachedRowSetWriter.writeData().  It's not the conflict number 
>>> that is supposed to be.
>>> 
>>>  Test case:
>>>  The bug can be easily manifested in all SQL server environment. Here take 
>>> PostgreSQL for example.
>>>  1. The sql script to create a table
>>> CREATE TABLE ressystem.roomdescription
>>> (
>>>  roomdescription_id serial NOT NULL,
>>>  roomdescription character varying NOT NULL,
>>>  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
>>> )
>>> 
>>>  2.  Manually insert 3 rows
>>> (1, "Test 1")
>>> (2, "Test 2")
>>> (3, "Test 3")
>>> 
>>>  3. Create a Java class that connects the established database and then 
>>> execute the following code snippet.
>>> String query = "select roomdescription_id, roomdescription from 
>>> ressystem.roomdescription";
>>> Object[] values = {2, "Test2"};
>>> rs.setCommand(query);
>>> rs.execute(conn);
>>> rs.moveToInsertRow();
>>> for(int i=0; i>> rs.updateObject(i+1,values[i]);
>>> }
>>> rs.insertRow();
>>> rs.moveToCurrentRow();
>>> rs.acceptChanges(conn);
>>> 
>>>  4. An exception occurs with following output.
>>> javax.sql.rowset.spi.SyncProviderException: 4conflicts while synchronizing
>>>at 
>>> com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412)
>>>at 
>>> com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880)
>>> 
>>> 5. In fact, there is only one conflicting row but 4 were reported.
>>> 
>>> Best regards,
>>> Frank
>>> 
>>> On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote:
 Frank,
 
 If you can please post the bug info here, I will take a look at your patch
 
 Best
 Lance
 On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:
 
> Hi guys,
>  We discovered a bug in CachedRowSetWriter.writeData method where 
> incorrect number of conflicts is reported.  I searched in Oracle bug 
> database and no similar record was found.  So I submitted a new one whose 
> internal review ID is 2376620.  A test case with code is illustrated in 
> the bug submission that leverages PostgreSQL server but the issue is 
> platform independent and easy to reproduce.
>  I provided a patch review, available @
>  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
>  Is there anybody who is interested in patch and can also review bug 
> 2376620?  Your reply is appreciated.
> 
> Best regards,
> Frank
> 
> 
 
 Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
 Oracle Java Engineering
 1 Network Drive
 Burlington, MA 01803
 lance.ander...@oracle.com
 
>> 
>> 
>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> lance.ander...@oracle.com
>> 
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com



Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-29 Thread Frank Ding

Hi Lance,
  Sorry for late response and thanks for your comment.  You mean I can 
write a jtreg test case that connects to Java DB?  I can do that.


Best regards,
Frank

On 11/13/2012 10:13 PM, Lance Andersen - Oracle wrote:

Hi Frank,


Thank you for the note
If you could in the future, please provide  a  complete test program to repro 
the issue as it would save time with the reviews.  Ideally if the issue is not 
database specific it would be good to leverage Java DB as it is included within 
Oracle JDK

I will look at this sometime this week

Best
Lance
On Nov 12, 2012, at 9:25 PM, Frank Ding wrote:


Hi Lance
  Thanks for your quick response.  Please find the bug info below.

  The problem:
  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
conflicts, if any, is reported.  The number of conflicts is the actual number 
of existing rows in database, which is the size of variable 'status' defined in 
CachedRowSetWriter.writeData().  It's not the conflict number that is supposed 
to be.

  Test case:
  The bug can be easily manifested in all SQL server environment. Here take 
PostgreSQL for example.
  1. The sql script to create a table
CREATE TABLE ressystem.roomdescription
(
  roomdescription_id serial NOT NULL,
  roomdescription character varying NOT NULL,
  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
)

  2.  Manually insert 3 rows
(1, "Test 1")
(2, "Test 2")
(3, "Test 3")

  3. Create a Java class that connects the established database and then 
execute the following code snippet.
String query = "select roomdescription_id, roomdescription from 
ressystem.roomdescription";
Object[] values = {2, "Test2"};
rs.setCommand(query);
rs.execute(conn);
rs.moveToInsertRow();
for(int i=0; i
Frank,

If you can please post the bug info here, I will take a look at your patch

Best
Lance
On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:


Hi guys,
  We discovered a bug in CachedRowSetWriter.writeData method where incorrect 
number of conflicts is reported.  I searched in Oracle bug database and no 
similar record was found.  So I submitted a new one whose internal review ID is 
2376620.  A test case with code is illustrated in the bug submission that 
leverages PostgreSQL server but the issue is platform independent and easy to 
reproduce.
  I provided a patch review, available @
  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
  Is there anybody who is interested in patch and can also review bug 2376620?  
Your reply is appreciated.

Best regards,
Frank




Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com




Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com





Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-13 Thread Lance Andersen - Oracle
Hi Frank,


Thank you for the note 
If you could in the future, please provide  a  complete test program to repro 
the issue as it would save time with the reviews.  Ideally if the issue is not 
database specific it would be good to leverage Java DB as it is included within 
Oracle JDK

I will look at this sometime this week

Best
Lance
On Nov 12, 2012, at 9:25 PM, Frank Ding wrote:

> Hi Lance
>  Thanks for your quick response.  Please find the bug info below.
> 
>  The problem:
>  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
> conflicts, if any, is reported.  The number of conflicts is the actual number 
> of existing rows in database, which is the size of variable 'status' defined 
> in CachedRowSetWriter.writeData().  It's not the conflict number that is 
> supposed to be.
> 
>  Test case:
>  The bug can be easily manifested in all SQL server environment. Here take 
> PostgreSQL for example.
>  1. The sql script to create a table
> CREATE TABLE ressystem.roomdescription
> (
>  roomdescription_id serial NOT NULL,
>  roomdescription character varying NOT NULL,
>  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
> )
> 
>  2.  Manually insert 3 rows
> (1, "Test 1")
> (2, "Test 2")
> (3, "Test 3")
> 
>  3. Create a Java class that connects the established database and then 
> execute the following code snippet.
> String query = "select roomdescription_id, roomdescription from 
> ressystem.roomdescription";
> Object[] values = {2, "Test2"};
> rs.setCommand(query);
> rs.execute(conn);
> rs.moveToInsertRow();
> for(int i=0; i rs.updateObject(i+1,values[i]);
> }
> rs.insertRow();
> rs.moveToCurrentRow();
> rs.acceptChanges(conn);
> 
>  4. An exception occurs with following output.
> javax.sql.rowset.spi.SyncProviderException: 4conflicts while synchronizing
>at 
> com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412)
>at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880)
> 
> 5. In fact, there is only one conflicting row but 4 were reported.
> 
> Best regards,
> Frank
> 
> On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote:
>> Frank,
>> 
>> If you can please post the bug info here, I will take a look at your patch
>> 
>> Best
>> Lance
>> On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:
>> 
>>> Hi guys,
>>>  We discovered a bug in CachedRowSetWriter.writeData method where incorrect 
>>> number of conflicts is reported.  I searched in Oracle bug database and no 
>>> similar record was found.  So I submitted a new one whose internal review 
>>> ID is 2376620.  A test case with code is illustrated in the bug submission 
>>> that leverages PostgreSQL server but the issue is platform independent and 
>>> easy to reproduce.
>>>  I provided a patch review, available @
>>>  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
>>>  Is there anybody who is interested in patch and can also review bug 
>>> 2376620?  Your reply is appreciated.
>>> 
>>> Best regards,
>>> Frank
>>> 
>>> 
>> 
>> 
>> Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
>> Oracle Java Engineering
>> 1 Network Drive
>> Burlington, MA 01803
>> lance.ander...@oracle.com
>> 
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com



Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-12 Thread Frank Ding

Hi Lance
  Thanks for your quick response.  Please find the bug info below.

  The problem:
  When CachedRowSetImpl.acceptChanges() is called, incorrect number of 
conflicts, if any, is reported.  The number of conflicts is the actual 
number of existing rows in database, which is the size of variable 
'status' defined in CachedRowSetWriter.writeData().  It's not the 
conflict number that is supposed to be.


  Test case:
  The bug can be easily manifested in all SQL server environment. Here 
take PostgreSQL for example.

  1. The sql script to create a table
CREATE TABLE ressystem.roomdescription
(
  roomdescription_id serial NOT NULL,
  roomdescription character varying NOT NULL,
  CONSTRAINT roomdescription_pkey PRIMARY KEY (roomdescription_id)
)

  2.  Manually insert 3 rows
(1, "Test 1")
(2, "Test 2")
(3, "Test 3")

  3. Create a Java class that connects the established database and 
then execute the following code snippet.
String query = "select roomdescription_id, roomdescription from 
ressystem.roomdescription";

Object[] values = {2, "Test2"};
rs.setCommand(query);
rs.execute(conn);
rs.moveToInsertRow();
for(int i=0; iat 
com.sun.rowset.internal.CachedRowSetWriter.writeData(CachedRowSetWriter.java:412)
at 
com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:880)


 5. In fact, there is only one conflicting row but 4 were reported.

Best regards,
Frank

On 11/9/2012 7:41 PM, Lance Andersen - Oracle wrote:

Frank,

If you can please post the bug info here, I will take a look at your patch

Best
Lance
On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:


Hi guys,
  We discovered a bug in CachedRowSetWriter.writeData method where incorrect 
number of conflicts is reported.  I searched in Oracle bug database and no 
similar record was found.  So I submitted a new one whose internal review ID is 
2376620.  A test case with code is illustrated in the bug submission that 
leverages PostgreSQL server but the issue is platform independent and easy to 
reproduce.
  I provided a patch review, available @
  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
  Is there anybody who is interested in patch and can also review bug 2376620?  
Your reply is appreciated.

Best regards,
Frank





Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering
1 Network Drive
Burlington, MA 01803
lance.ander...@oracle.com





Re: JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-09 Thread Lance Andersen - Oracle
Frank,

If you can please post the bug info here, I will take a look at your patch

Best
Lance
On Nov 8, 2012, at 10:01 PM, Frank Ding wrote:

> Hi guys,
>  We discovered a bug in CachedRowSetWriter.writeData method where incorrect 
> number of conflicts is reported.  I searched in Oracle bug database and no 
> similar record was found.  So I submitted a new one whose internal review ID 
> is 2376620.  A test case with code is illustrated in the bug submission that 
> leverages PostgreSQL server but the issue is platform independent and easy to 
> reproduce.
>  I provided a patch review, available @
>  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
>  Is there anybody who is interested in patch and can also review bug 2376620? 
>  Your reply is appreciated.
> 
> Best regards,
> Frank
> 
> 


Lance Andersen| Principal Member of Technical Staff | +1.781.442.2037
Oracle Java Engineering 
1 Network Drive 
Burlington, MA 01803
lance.ander...@oracle.com



JDBC bug: Incorrect number of conflicts is reported by CachedRowSetWriter.writeData

2012-11-08 Thread Frank Ding

Hi guys,
  We discovered a bug in CachedRowSetWriter.writeData method where 
incorrect number of conflicts is reported.  I searched in Oracle bug 
database and no similar record was found.  So I submitted a new one 
whose internal review ID is 2376620.  A test case with code is 
illustrated in the bug submission that leverages PostgreSQL server but 
the issue is platform independent and easy to reproduce.

  I provided a patch review, available @
  http://cr.openjdk.java.net/~dingxmin/2376620/webrev.01/
  Is there anybody who is interested in patch and can also review bug 
2376620?  Your reply is appreciated.


Best regards,
Frank