db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "Derby3192Writeup" by DyreTjeldvoll
Date Fri, 15 Feb 2008 09:11:38 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by DyreTjeldvoll:
http://wiki.apache.org/db-derby/Derby3192Writeup

------------------------------------------------------------------------------
  
  == Implementing Piggy-backing ==
  
- /!\ '''The following paragraphs are still under construction. More details can be found
at [https://issues.apache.org/jira/browse/DERBY-3192 DERBY-3192].''' /!\
- 
  The discussion at [https://issues.apache.org/jira/browse/DERBY-3192 DERBY-3192] showed that
it is possible to add new ''product-specific'' code points which can be used to implement
piggy-backing. This idea is the basis for the `derby-3192-mark2.*.diff` series of patches,
and is described in the following paragraphs.
  
  
  === Getting session data from the embedded driver ===
  
- In order for piggy-backing to be reasonably efficient the !NetworkServer needs an efficient
(and preferably) convenient way of obtaining the session data from its `EmbedConnection`,
preferably by providing a `getCurrentSchemaName()` method. It would of course be possible
to implement this by executing `VALUES CURRENT ISOLATION` on the embedded connection, but
this seems like much overhead, especially when considering that this query will have to be
performed whenever the !NetworkServer needs to know if the session data has changed.
+ In order for piggy-backing to be reasonably efficient the !NetworkServer needs a cheap (and
preferably convenient) way of obtaining session data from its `EmbedConnection`. The proposed
patch achieves this by adding a new method, `EngineConnection.getCurrentSchemaName()` that
is implemented in `EmbedConnection` by simply forwarding to the `LanguageConnectionContext`.
  
+ It is probably possible to do this by executing `VALUES CURRENT SCHEMA` on the embedded
connection. Preparing the query on the server would give the benefit a shared, cached query
plan, but this would still be considerably more costly than direct access, especially since
there would be substantial contention for the shared query plan. This query would, after all,
need to be executed once for each statement which has the potential to modify session data.

+ 
+ One way of reducing the number of calls is to use a callback to notify the !NetworkServer
layer about changes to session data. This approach would probably be the most efficient, but
it would also require more invasive changes to the embedded driver. It also has the potential
to introduce unwanted coupling between the embedded driver and the !NetworkServer.
  
  === Identifying session data changes ===
+ 
+ /!\ '''The following paragraphs are still under construction. More details can be found
at [https://issues.apache.org/jira/browse/DERBY-3192 DERBY-3192].''' /!\
  
  Given that we have chosen to poll for changes to the session data in the `EmbedConnection`
each time they may have changed, we also need the ability to store the last
  values sent to the client, and a way to compare those with the current values from `EmbedConnection`.


Mime
View raw message