This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information

--Controlling Meta Data Caching

Documents for the development of and with JVx.

--Controlling Meta Data Caching

Postby Development@SIB » Fri Sep 17, 2010 10:58 am



This article is outdated - please use our new system at

https://doc.sibvisions.com




A database application always requires meta data where single columns are defined and described. This includes information about which column is the primary key, the column´s data type, and potentially the length and if zero values can be accepted. All of this information is called meta data.

JVx automatically assumes meta data from the database. This way domain models do not have to be created, although nothing would stop us from doing so.

The user interface also needs meta data to work properly, since, for example, no letters can be entered in a numerical column. The meta data therefore has to be transmitted from the server to the client (of course for each server object).
The necessary request, and also the data transmission of course, take some time. During productive operation we would rather avoid this loss of performance.

For this reason JVx has an automatic meta data cache.

This cache supports various modes:

  • Global
    The cache works statically, per VM instance, depending on how the cache is built up (dynamically or pre-set). Ideally, only one request for the meta data of all server objects of the entire application is required.
  • DataSource
    The cache is tied to a datasource; the meta data for all server objects is transmitted via a single request. Therefore one request for meta data is required per data source.
  • Off
    Deactivates the meta data cache; one meta data request is required per server object.

The cache is configured using the following method:

Code: Select all
RemoteDataSource.setMetaDataCacheRole(MetaDataCacheRole)


The Global Cache can be addressed using the following methods:

Code: Select all
//put meta data to the global cache
RemoteDataSource.putGlobalMetaData(String, MetaData)

//get meta data from the global cache
RemoteDataSource.getGlobalMetaData(String)


The DataSource Cache can be accessed, per RemoteDataSource instance, using the following methods:

Code: Select all
//put datasource meta data
dataSource.putMetaData(String, MetaData)

//get datasource meta data
dataSource.getMetaData(String)


Note

The meta data cache is dynamically built up at the server and updated continuously. To enable the cache buildup, the user interface has to access the server objects after the start of the application server.
User avatar
Development@SIB
 
Posts: 325
Joined: Mon Sep 28, 2009 1:54 pm

Return to Documentation