• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RowSet serialization

 
Ranch Hand
Posts: 1419
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A disconnected RowSet can be serialized, sent to a client for update, and de-serialized back at the server to synchronize the changes with the database.

I suppose that the RowSet cannot be serialized until it has been disconnected; i.e. the Connection closed. But what happens to the DataSource attribute during serialization? You can have a DataSource object without being connected to the database. (It merely retains the information needed to _get_ an active database Connection).

I suppose it would be convenient for a serialized RowSet to maintain the DataSource information. Then, when the updated RowSet is returned by the remote client, it remembers how to reconnect to the database.

But I see some dangers with allowing the DataSource to be serialized. The client might try to reconnect the RowSet to the database without having the necessary database drivers (or permissions). Of course, the RowSet could simply throw an exception, but this would be kind of ugly.

My guess is that the DataSource is a nonserialized attribute of the RowSet -- and therefore which would have to be reset upon deserialization before updates could be synchronized. Is this indeed the specification?

(I suppose I could write a program to try it out myself, but that would say more about my specific RowSet implementation than about the way it _should_ work.)
 
Frank Silbermann
Ranch Hand
Posts: 1419
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone point me to the JavaDoc API for Sun's reference implementation "CachedRowSetImpl"? That might answer my question.
 
reply
    Bookmark Topic Watch Topic
  • New Topic