This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 123537

Summary: Consider caching rowset metadata to avoid DB access at design time
Product: obsolete Reporter: Mark Dey <markdey>
Component: visualwebAssignee: John Baker <jbaker>
Status: RESOLVED FIXED    
Severity: blocker CC: davidvc
Priority: P2 Keywords: PERFORMANCE
Version: 6.x   
Hardware: All   
OS: All   
URL: http://wiki.netbeans.org/wiki/view/VisualWebDatabaseCacheMetadata
Issue Type: DEFECT Exception Reporter:
Bug Depends on: 109163, 124931    
Bug Blocks: 94430, 122667    

Description Mark Dey 2007-12-06 06:31:10 UTC
Live DB connection is made at design time just to populate components with dummy data of correct type. This metadata should be cached so that subsequent 
DB access is not necessary.
Comment 1 John Baker 2007-12-12 01:57:50 UTC
Will not use DdlUtils, instead use serializaton.

DdlUtils does not handle result sets well and is better suited for runtime.
Also, is not generic - requires some platform specific information 
Comment 2 John Baker 2007-12-14 02:51:19 UTC
Depended on 109163 since reliable project information is needed
Comment 3 John Baker 2008-01-09 07:48:10 UTC
Prototype in local worksparce is basically working.
Would work better if 124931 is fixed
Need to do some performance comparisons with 6.0
Comment 4 John Baker 2008-01-09 07:57:31 UTC
Adding 124931

If 124931 is not addressed then at startup , if pages open with project then the CachedRowSetDataProvider.getMetaData is
invoked unexpectedly and NPE occurs.

However, even without the implementation of this issue (Caching rowset metadata) NPE still occurs for the use case above
Comment 6 John Baker 2008-01-21 09:38:55 UTC
Some test data.
Project contains 
1 Table component
1 Trip database table joined with TripType table

I. Open page test
a) Local database
a1) time using 6.0 = 16 seconds
a2) time using serialized file = 15 seconds

about -1 second improvement

b) Remote database
b1) time using 6.0 = 22 seconds
b2) time using serialized file = 15 seconds

about 7 second improvement


II Open Table Layout dialog

a) remote or local database (no noticable difference remote vs. local database)
a1) time using 6.0 = very slight delay.,  1 second, if that
a2) time using serialized file = instantaneous


Note:  test is a very simple page with just one component bound to one rowset.
Applications may have multiple components bound to multiple rowsets.

One additional advantage of serializing the metadata is there are almost no instances of the
Component Error page that occurs when a database connection is not connected and a rowset from the database is bound to
a component



Comment 7 John Baker 2008-01-21 09:55:36 UTC
In the test page open measurements, note that the times to bind to the data source only take a fraction of the time.

To open 1 page with 1 Table component, on my laptop, it takes about 13 seconds.
So about 2 seconds to do the binding to a serialized rowset.

Compared to 9 seconds for binding to a rowset from a remote database live connection
Comment 8 John Baker 2008-01-21 12:05:17 UTC
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/CachedRowSetDataProvider.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/CachedRowSetDataProvider.java,v  <-- 
CachedRowSetDataProvider.java
new revision: 1.10; previous revision: 1.9
done
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataDeserializer.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataDeserializer.java,v  <-- 
MetaDataDeserializer.java
new revision: 1.2; previous revision: 1.1
done
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataSerializer.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataSerializer.java,v  <-- 
MetaDataSerializer.java
new revision: 1.2; previous revision: 1.1
done
Comment 9 John Baker 2008-01-22 07:05:38 UTC
Some more updates
cvs commit: Examining visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/CachedRowSetDataProvider.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/CachedRowSetDataProvider.java,v  <-- 
CachedRowSetDataProvider.java
new revision: 1.11; previous revision: 1.10
done
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataDeserializer.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataDeserializer.java,v  <-- 
MetaDataDeserializer.java
new revision: 1.3; previous revision: 1.2
done
Checking in visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataSerializer.java;
/cvs/visualweb/dataprovider/runtime/library/src/com/sun/data/provider/impl/MetaDataSerializer.java,v  <-- 
MetaDataSerializer.java
new revision: 1.3; previous revision: 1.2
done