On Wed, 9 Mar 2005 08:41:52 +0100 (CET), Mamta A. Satoor (JIRA)
<[email protected]> wrote:
DatabaseMetaData calls related to changes made by others return incorrect values in Network Server mode.
--------------------------------------------------------------------------------------------------------
Key: DERBY-169
URL: http://issues.apache.org/jira/browse/DERBY-169
Project: Derby
Type: Bug
Components: Network Server
Versions: 10.0.2.1
Reporter: Mamta A. Satoor
Assigned to: Mamta A. Satoor
I am working on getting updatable resultsets to work under Network Server mode. While running the test lang/updatableResultSet.java in Network Server mode, I came across following issue. DatabaseMetaData among other methods has 3 methods, othersUpdatesAreVisible, othersDeletesAreVisible and othersInsertsAreVisible. These 3 methods currently return true for TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE when running in Network Server mode. They should be returning false for TYPE_SCROLL_INSENSITIVE and TYPE_SCROLL_SENSITIVE. The reason for that is
Derby does not yet implement scroll sensitive ResultSets and hence the 3 metadata calls mentioned above should return false. Also, scroll insensitive ResultSets by their definition do not see changes made by others and hence the 3 metadata calls should return false.
The fix for this is very easy and requires changes in apache\derby\impl\sql\catalog\metadata_net.properties.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
Here is a very simple fix for the bug with the tests, I have run the
test suites and the fix hasn't caused any failures.
svn stat output
M java\engine\org\apache\derby\impl\sql\catalog\metadata_net.properties
M java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\metadataJdbc20.java
M java\testing\org\apache\derbyTesting\functionTests\master\DerbyNet\metadataJdbc20.out
M java\testing\org\apache\derbyTesting\functionTests\master\metadataJdbc20.out
M java\testing\org\apache\derbyTesting\functionTests\master\DerbyNetClient\metadataJdbc20.out
Thanks,
Mamta
Index: java/engine/org/apache/derby/impl/sql/catalog/metadata_net.properties
===================================================================
--- java/engine/org/apache/derby/impl/sql/catalog/metadata_net.properties (revision 156618)
+++ java/engine/org/apache/derby/impl/sql/catalog/metadata_net.properties (working copy)
@@ -298,9 +298,9 @@
'',\
'',\
'',\
- '1003,1004,1005',\
- '1003,1004,1005',\
- '1003,1004,1005',\
+ '1003',\
+ '1003',\
+ '1003',\
'',\
'',\
'',\
Index: java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java (revision 156618)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/metadataJdbc20.java (working copy)
@@ -88,6 +88,21 @@
userNamedTypes[1] = java.sql.Types.STRUCT;
dumpRS(met.getUDTs("a", null, null, userNamedTypes));
+ System.out.println("Test the metadata calls related to visibility of changes made by others for different resultset types");
+ System.out.println("Since Derby materializes a forward only ResultSet incrementally, it is possible to see changes");
+ System.out.println("made by others and hence following 3 metadata calls will return true for forward only ResultSets.");
+ System.out.println("othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ System.out.println("othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ System.out.println("othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY)? " + met.othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY));
+ System.out.println("Scroll insensitive ResultSet by their definition do not see changes made by others and hence following metadata calls return false");
+ System.out.println("othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ System.out.println("othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ System.out.println("othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? " + met.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE));
+ System.out.println("Derby does not yet implement scroll sensitive resultsets and hence following metadata calls return false");
+ System.out.println("othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+ System.out.println("othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+ System.out.println("othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? " + met.othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE));
+
s.close();
con.close();
Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out (revision 156618)
+++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/metadataJdbc20.out (working copy)
@@ -11,4 +11,18 @@
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+Test the metadata calls related to visibility of changes made by others for different resultset types
+Since Derby materializes a forward only ResultSet incrementally, it is possible to see changes
+made by others and hence following 3 metadata calls will return true for forward only ResultSets.
+othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+Scroll insensitive ResultSet by their definition do not see changes made by others and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+Derby does not yet implement scroll sensitive resultsets and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
Test metadataJdbc20 finished
Index: java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out (revision 156618)
+++ java/testing/org/apache/derbyTesting/functionTests/master/metadataJdbc20.out (working copy)
@@ -11,4 +11,18 @@
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+Test the metadata calls related to visibility of changes made by others for different resultset types
+Since Derby materializes a forward only ResultSet incrementally, it is possible to see changes
+made by others and hence following 3 metadata calls will return true for forward only ResultSets.
+othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+Scroll insensitive ResultSet by their definition do not see changes made by others and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+Derby does not yet implement scroll sensitive resultsets and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
Test metadataJdbc20 finished
Index: java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadataJdbc20.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadataJdbc20.out (revision 156618)
+++ java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadataJdbc20.out (working copy)
@@ -11,4 +11,18 @@
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
getUDTs() with user-named types in ('JAVA_OBJECT', 'STRUCT') :
TYPE_CAT,TYPE_SCHEM,TYPE_NAME,CLASS_NAME,DATA_TYPE,REMARKS
+Test the metadata calls related to visibility of changes made by others for different resultset types
+Since Derby materializes a forward only ResultSet incrementally, it is possible to see changes
+made by others and hence following 3 metadata calls will return true for forward only ResultSets.
+othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY)? true
+Scroll insensitive ResultSet by their definition do not see changes made by others and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_INSENSITIVE)? false
+Derby does not yet implement scroll sensitive resultsets and hence following metadata calls return false
+othersUpdatesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersDeletesAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
+othersInsertsAreVisible(ResultSet.TYPE_SCROLL_SENSITIVE)? false
Test metadataJdbc20 finished