Creating a View Model

Create a view model to specify how your data service combines and transforms data. You have the option of making the view model transactional. Follow these steps to use the view model wizard to set up a skeleton view model; later you can add data input sources and operators to manipulate the data.

Prerequisites 

Create a WorkSpace Data Federation project where you can save your view model.

  1. Select File > New > View Model . The View Model wizard appears.
  2. Complete the following information on the first wizard page.
    Table 1. View Model Wizard, first page
    Field Description
    Container Type the name of an existing project directory for this view model, or use the Browse button to search for one.
    File Name Type a name for the view model. Make sure the extension is .avm.
    Select a Grid Domain Controller A list of available GDCs displays. Select a GDC for this view model.

    Optionally, you can ping the GDC by clicking Test Connection.

    If the ping fails, verify the GDC property values.

    If you have not yet configured a GDC, you can click New to open the Create a Data Federation GDC Connection Profile wizard.
  3. If you are not creating a transactional view model, skip to step 6. WorkSpace Data Federation creates and opens the view model in the editor.
  4. If you are creating a transactional view model, click Next. The Transaction Properties page of the View Model wizard appears.
  5. Fill in the transaction properties as follows.
    Table 2. View Model Wizard, second page
    Field Description
    Make the data service deployed from this view model transactional Check this box to enable transactionality.
    Include input data services referenced by this data service If other data services provide input to this data service, check this box to apply the transactional properties defined for this DataService to the input data services.

    If this box is not checked, any input data services referenced by this data service will run with their original transactional properties.

    Note: Input data services can be included in this data service’s transaction only if (a) the input data services reside in the same grid domain as this data service, and (b) the input data services are configured to the same type of transactionality as this data service. Transactionality type is defined by the radio buttons Include all XA database connections within the transaction and Include single non-XA database connector in transaction.
    Transaction isolation
    Choose an isolation level. In general, isolation levels let you balance speed and accuracy. Lower isolation levels allow faster processing, while higher isolation levels ensure more correct data. Here, myTransaction means the transaction being executed by this data service, including operations performed by any inputs to this data service that are included in this data service’s transaction.
    • Connection.TRANSACTION_READ_UNCOMMITTED. This is the lowest level of isolation. myTransaction can read data that has not been committed by another transaction. If the other transaction is rolled back, myTransaction may produce bad results.
    • Connection.TRANSACTION_READ_COMMITTED. Default value. myTransaction can read only data that has been committed. However, data needed for myTransaction can be updated by other transactions before myTransaction is committed.
    • Connection.TRANSACTION_REPEATABLE_READ. Once myTransaction reads the data it needs, that data cannot be updated by another transaction until myTransaction is committed. The data can be read by other transactions.
    • Connection.TRANSACTION_SERIALIZABLE. This is the highest level of isolation. Once myTransaction reads the data it needs, that data cannot be read or updated by another transaction until myTransaction is committed.
    Note: The transaction isolation setting you choose is passed to the DBMS. Although Data Federation’s isolation options are based on widely used industry standards, some DBMSes don’t accept all of them. See the documentation for your DBMS for details on how it handles transaction isolation.
    Include all XA database connections within the transaction Click this button if you want this data service’s transaction to include inputs that use the XA protocol, or if this data service will serve as an input to another data service that uses the XA protocol.
    Note: If you choose this option, you must have at least one XA-enabled database connector in this grid domain.
    Include single non-XA database connector in transaction Click this button if you want this data service’s transaction to include inputs that do not use the XA protocol, or if this data service will serve as an input to another data service that does not use the XA protocol.
    Database connector If you chose Include single non-XA database connector in transaction, select a database connector from the pull-down menu.
    Note: When your view model is displayed in the editor, you can display and edit transaction properties in the Properties view.
  6. Click Finish. Data Federation creates and opens the view model in the editor.
  7. Use the mouse to drag the Result element to the right side of the view model pane.
  8. Select File > Save to save your view model.
Next 

Add input sources and operators to your view model.

For product-related issues, contact Sybase Technical Support at 1-800-8SYBASE. Send your feedback on this help topic directly to Sybase Technical Publications: pubs@sybase.com