5 Using Mobile Database Workbench to Create Publications

The Mobile Database Workbench (MDW) is a new tool that enables you to iteratively create and test publications—testing each object as you add it to a publication. Publications are stored within a project, which can be saved and restored from your file system, so that you can continue to add and modify any of the contained objects within it.

All work is created within a project, which can be saved to the file system and retrieved for further modifications later. Once you create the project, start creating the publication items, sequences, scripts and resources that are to be associated with the publication. You can create the publication and associated objects in any order, but you always associate an existing object with the publication. Thus, it saves time to start with creating the objects first and associating it with the publication afterwards.

The following sections describe how to first create a project and then create the other objects contained within a publication.

5.1 Create a Project

Create a new project with the Project Wizard. The project is the vehicle that contains your iterative approach to defining publications, publication items, sequences, scripts and resources. The project can be saved and restored from your file system, so that you can continue to modify any of the contained objects within it.

You cannot perform any action on developing your publications without first creating the project.

You must have access to the back-end database with the Oracle Mobile Repository and already defined the tables and schema that you are going to be using in your publication items before entering the project wizard.

Perform the following to create the project:

  1. Click File->New->Project to start the Project Wizard.

  2. An Introductory screen appears. If you do not want this introductory screen to display each time you start a new project, check the "Skip This Page Next Time" box.

  3. Define the project name. Enter the project name and location for your new project, as follows:

    • Project name: This name can be any valid Java identifier. The name cannot contain any spaces. For example, your project name may be something like MY_NEW_PROJECT.

    • Project location: Enter a valid location in the directory on your machine that has write permission to store the project. On a Windows machine, you could enter the location as c:\myprojects. To browse for a directory, click Browse.

    Click Next to move to the next step in the wizard.

  4. Provide the Mobile Repository access information. Because you are interacting with the repository to create and manipulate synchronization objects, including the SQL scripts for the publication items, you need access to the Mobile Repository. Enter the following access information:

    • User name and password: Specify the Mobile Server repository user name and password (with administrator privilege). This is the same user name and password with which the repository was originally created. For example, the default Mobile Server repository user name and password is mobileadmin/manager.

    • JDBC driver type: Select the JDBC driver that is used to connect to the Oracle database that hosts the Mobile Server repository. At this time, the only driver that you can choose is the Oracle Thin driver.

    • Host name or IP address, port number, and SID: Enter the location, port, and SID of the database that contains the Mobile Server Repository. For the location, you can either enter the host name or the IP address. The port and SID are configured within the definition of the Oracle database and are used to access the database. For example, the host, port and SID could be my-pc1, 1521, and orcl.

    Click Next to move to the next step in the wizard. Once you click Next, the wizard verifies that the database connection information is correct. If incorrect, the wizard prompts you to re-enter the information. You can only advance if you enter the correct information where the Mobile Server Repository is located.

  5. Specify schema username and password. Enter the user and password of the schema owner for the schema that you are using for the Mobile application. The Mobile application schema contains all database tables, views, synonyms used to build the snapshots for the application.


    Note:

    All schema objects for an application exist in the same back-end repository, which is why the Oracle database host, port and SID are only read-only on this screen.

    Click Next to move on to the last screen in the Project Wizard. As you click Next, MDW verifies that the username and password that you entered are valid for connecting to the application schema in the back-end database. If these are not valid, you cannot advance until you supply a valid username and password.

  6. A summary page appears. Once the creation of the project is completed, this page displays all of the information about your new project.

    • Click Back to modify any of the information supplied.

    • Click Finish to complete the project creation.

    • Click Cancel to abort creation of this project.

5.2 Create a Publication Item

The Publication Item Wizard steps you through the process of creating a publication item in the project. A publication item encapsulates a snapshot definition. It can be based on a table, view or synonym in the Master Application schema in the back-end database. If you use a synonym for a remote object to build a publication item, then you are required to provide the JDBC connection information to the remote database where the remote object resides.

After you create the publication items in the project, then you can associate multiple publication items with a publication, which is then associated with an application. See Section 5.6.1, "Associate Publication Item With Publication" for details.

You can create a publication item through the publication item wizard by clicking File->New->Publication Item.

  1. The publication item wizard introduction appears. If you do not want this introductory screen to display each time you start a new project, check the "Skip This Page Next Time" box.

    Click Next to advance to the next screen.

  2. Define name and refresh type, as follows:

    • Publication item name: This name can be any valid Java identifier. The name cannot contain any spaces. Publication item names are limited to twenty-six characters and must be unique across all publications. For example, your publication item name may be something like MY_PUBLICATION_ITEM.

    • Refresh type: The refresh mode of the publication item is specified during creation to be either fast or complete refresh. See the Section 3.8, "Understanding Your Refresh Options" for more information.

      From the drop-down list choose one of the following refresh types:

      • Complete: All data is refreshed with current data. Everytime you synchronize, all data in the snapshot is retrieved. This can be performance intensive.

      • Fast: This is the recommended mode. Only incremental changes are synchronized. Thus, you are not downloading the complete data snapshot each time a synchronization is requested. The advantages of fast refresh are reduced overhead and increased speed when replicating data stores with large amounts of data where there are limited changes between synchronization sessions.

      • Queue-based: You can create your own queue. Mobile Server will upload and download changes from the user. You perform the activity of the MGP and apply/compose the modifications to the back-end database. See the Section 3.15, "Customizing Replication With Your Own Queues" for more information.

      Once you create the publication item with a particular refresh type, the only way to modify the publication item to have a different refresh type is to delete is and recreate it with the desired refresh type.

  3. Designate the publication item object with the appropriate schema, as follows:

    • Choose the application schema to associate with this publication item: The application schema is the schema from which the publication item retrieves data. All available schemas in the database are listed in the pull-down list. You must have created the schema prior to creating the publication item.

      If the schema you want is not in this list, cancel this publication item, create the schema in the back-end database, and then associate the schema with the publication item.

    • Designate the object type as a table, view, or synonym.

    • To choose the table, view or synonym from within the schema that you wish to base this publication item on, click Search on the Object Filter. This brings up several items in the Object List. Select the object that you are interested in and click Next.


      Note:

      To search only for objects that match a condition, designate the condition in the Filter box and click Search. You can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

  4. Choose columns to add to the publication item. There are two tabs to enable you to structure your publication item, as follows:

    • Column Selection: Choose the columns from within the object that you will use to retrieve information for the application. To choose the appropriate columns, select the column name and click the left or right arrow buttons to move between the Available and Selected windows. To move all columns, use the double arrows.


      Note:

      The primary key defaults to being in the Selected window, as it is required if you are using Fast Refresh and Updateable option. Since most publication items use these options, MDW places the primary key as Selected. You can move it back to the Available window.

    • Structure: If you are not sure what columns you want, you can see the entire table structure by clicking this tab.

    If you have specified a fast refresh, you must provide a primary key. If you have specified a table or view that does not have a primary key, exit out of this wizard and create a virtual primary key specifying one of the columns in the table or view. If you do not create a virtual primary key before specifying this publication item, then any future synchronization of this primary key will fail.

  5. Modify the SQL statement for the publication item. From the columns that you selected in the previous screen, this simple SQL statement is available as a template for you to modify. You can add any qualifiers and complexity to this base statement. To view the structure of the schema object, select the Structure tab.

  6. If you specified a view, then you may need to define parent table and primary key hints. See Section 5.2.3, "Specify Parent Table and Primary Key Hints" for directions on how to define these hints.

  7. Summary page provides an overview of the publication item that you just created. To view any dependency hints, click Advanced. If you have used a view as the base for your publication item and you created Parent Table or Primary Key hints, click Hint to view these hints. The Parent Table and Primary Key hints are only valid on views.

    To modify any part of the publication item, click Back to return to the previous screens.

    Click Finish if you are satisfied with the publication item. Click Cancel to eliminate all work in creating this publication item.

5.2.1 Create SQL Statement for Publication Item

You can compose your SQL statement through iterative steps to ensure that you are creating a valid statement. You have the following options:

  • Modify the query by clicking Edit.

  • Execute the statement against the schema in the back-end database by clicking Run. You will be notified directly if the statement fails or view the data from the schema object is retrieved for you to view.

    When you click Run, then the query of the publication item is validated by executing the query against the back-end database. A dialog is displayed with the returned snapshot that this publication item would generate. If there is more than one page, then click Previous and Next to move between the pages. Click Close to return to the publication item screen.

    If the publication item SQL statement requireds an input value, then a dialog appears for you to input the value for the SQL query. You can modify this value or the SQL query until you receive the results that you desire.

  • To return the query to the original statement, click Reset.

  • When finished, click Next.

5.2.2 Create a Dependency Hint

If the updates to this publication item effects another table, use the dependency hint to notify the synchronization engine to update the other table. For example, if the publication item updates the employee table, and these updates should also apply to the department table, add a dependency hint notifying the synchronization engine of the relationship with the department table.

For your dependency hint, specify whether the hint is based upon a table or synonym. Then, use the pulldown lists to select the schema and table/synonym names. Click OK to save the hint or Cancel to return to the Advanced screen.

For more information on dependency hints, see Section 3.13.2, "Creating or Removing a Dependency Hint".

5.2.3 Specify Parent Table and Primary Key Hints

When you use a view, you may need to specify a parent table and primary key hints. A view can be composed of one or more tables joined together. If you have specified fast refresh, then you must specify which table is the parent table and which column is the primary key.

  • To create a parent table hint, select the base table from the Base Table(s) drop-down list and check the Parent Table Hint checkbox.


    Note:

    If you do not check the Parent Table Hint checkbox, then the hint is not created when you click Next.

  • To create a primary key hint, click Add. Identify the primary key hint for this view, as follows:

    1. From the View Columns drop-down list, select the view column that you want to be the primary key. This column name may be an alias of the actual table.column name.

    2. From the Base Tables drop-down list, select the base table where the actual column exists that is to be the primary key.

    3. From the Primary Key Columns drop-down list, all primary key columns from the base table are shown, select the appropriate column for the primary key. If you have a composite primary key, iteratively add each column within the composite primary key.


      Note:

      If you do not provide accurate details in regards to the view, base table, and primary key to which the view column maps, the publication item may save, but the execution of the publication item will fail. For example, if you choose a view column which does not map to the primary key column, MDW will allow the action, but any execution of the publication item will result in failure.

    Click OK to accept this primary key hint.

5.3 Create a Sequence

A sequence is a database schema object that generates sequential numbers for new records into a table. After creating a sequence, you can use it to generate unique sequence numbers for transaction processing. These unique integers can include primary key values. If a transaction generates a sequence number, the sequence is incremented immediately whether you commit or roll back the transaction.

Create a sequence by clicking File->New->Sequence.

However, when you have Oracle Database Lite, you must consider how you allow the generation of sequence numbers. If you want the client only to use the sequence, you have a native sequence, which does not involve the server-side. However, if you want the server and client to share a sequence, you have to specify a server-side sequence and allow for both the client and server to be using numbers within the same range.

For example, if you have a single back-end database and a Mobile client, where both are allowed to add records to the application tables, then you have to check the checkbox to generate the server-side sequence and allow at least two as the increment value, since the client will use one and the server will use the other.

If you have more than a single client, you want to assign who gets which sequence numbers, so that when you synchronize, none of the records have duplicate sequence numbers. Thus, if you have multiple clients, then specify a specific range of numbers for each client, so that they are not using the same numbers.

  • Specify a range of values for each client. In our example, client A would be assigned sequence numbers 1 through 100, client B would be assigned sequence numbers 101 to 200, and client C would be assigned sequence numbers 201 through 300. If they ran out of sequence numbers, they are assigned another 100, which is the defined window size in our example, during the next synchronization. Since none of the clients checked to generate server-side sequence, the database, in order to never collide with the sequence numbers, starts its sequence number at -1.

  • You could specify that all clients are allowed to have only odd numbers and the database has all even numbers. That is, you could start the client at 1 and increment by 2 for all of its sequence numbers. This enables you to avoid having negative numbers for your sequence numbers. The clients still have a window size, which in this example is 100, but they start with an odd number within that window and always increment by 2 to avoid any positive numbers. Thus, client A would still have the window of 1 to 100, but the sequence numbers would be 1, 3, 5, and so on up to 99.

To create a sequence, provide the following information:

  • Name: This name must be a valid Java identifier.

  • Starts With: Enter the number with which you want this sequence to start.

  • Increment: Specify the increment from the starting value for the next value in the sequence.


    Note:

    If you have checked the Generate server-side sequence checkbox and set the increment value to 1, then this value is ignored and is set to 2. When you specify the server-side sequence, then both the client and the server use every other number in the sequence. Thus, you cannot increment by 1 on the client.

  • Window Size: The range of numbers given to the client when the threshold is reached.

  • Threshold: Defining the amount of sequence numbers necessary to be assigned in order for operations to continue smoothly.

  • Description: A description of the sequence.

  • Generate server-side sequence: If you want the client and the server-sides to share a sequence, where one side has all even numbers and the other has the odd numbers, check this box. If unchecked, then the sequence is created solely for the client.

Once you create a sequence in the project, you can associate it with a publication. See Section 5.6.2, "Associate a Sequence With the Publication" for details.

See the Section 3.3.1.7, "Creating Client-Side Sequences for the Downloaded Snapshot" for more information on sequences.

5.4 Test and Load a Script Into The Project

You can add a script to this project. Create the script on your file system and then upload it to MDW. Before you add the script to the project, you can use MDW to test the script. See the following sections for more information:

5.4.1 Test SQL Scripts

You can test a SQL script that resides on your file system by selecting Tool->SQL Window. Through the SQL Wizard, perform the following:

  1. Connect to the correct database—whether it is an Oracle database or a device Oracle Lite database.

  2. Load the SQL script from your file system.

  3. Execute the script. You can execute the current script or re-execute scripts that are on the history page. You can choose to have the results displayed on the screen or spooled to a file.

The following sections describe how to accomplish these tasks:

5.4.1.1 Connect to the Database

  1. Select type of database—Select the radio button next to the type of database to which you are connecting—an Oracle database or the client Oracle Lite database. If you selected the client Oracle Lite database, you must also specify the Mobile client platform and protocol with the drop-down lists. Only currently installed platforms and protocols are displayed in these drop-down lists.

  2. Specify database authentication and destination connection information—Part of the information necessary for completing the database connection is the authentication user name and password and the database destination information, which can include either the DSN of the Mobile client Oracle Lite database or the host, port, and SID for the Oracle database.

  3. Review database connection values—The final screen displays a summary of all of the configured values for the database connection. Verify that the information is correct and then click Finish. You can return to any page to modify the information by clicking Back.

5.4.1.2 Load and Execute SQL Scripts

You can test any SQL scripts against the database defined in the previous portion of this wizard.

  • Click Load Script to browse your file system for the script that you want to test. Define if you want this script to be spooled or auto-committed.

  • Click Execute to run the script on the destination database. The results show up in the bottom results screen.

    If you want, you can spool the results to a file by checking the spool checkbox before you click Execute. When you check Spool, a dialog appears for you to define the location and name of the file to receive the output from the script. Check the Overwrite checkbox if you want this file overwritten each time that the script is executed.

    Check the Autocommit checkbox if you want the SQL committed automatically after the script completes.

The Results and History tabs show the current results and all past results respectively. Clear the Results screen by either clicking Clear Results or by checking the Auto Clear checkbox. Clear the historical information by clicking the Clear History button on the History page.


Note:

Any SQL on the History page can be executed by selecting the corresponding row and clicking Execute.

5.4.2 Load the Script Into the Project

Define the script on your machine. Once defined, bring the script into the project by clicking File->New->Script. Provide a user-defined name to identify the script and browse for the script in your file system. Click OK to accept the definition and Cancel to return to the previous screen.

Once you include a script in the project, you can associate it with a publication. See Section 5.6.3, "Associate a Script With the Publication" for more information.

5.5 Load a Resource Into the Project

You can specify that Java class files and binaries archived in a JAR file is downloaded to the client on the first synchronization by specifying an existing resource. In addition, if this resource is modified, it will be sent down on the next synchronization.

To specify an existing resource, click File->New->Resource.

Provide the JAR file on your machine. Specify a user-defined name to identify the resource and browse for the JAR file in your file system. Click OK to accept the definition and Cancel to return to the previous screen.

Once you include a resource in the project, you can associate it with a publication. See Section 5.6.4, "Associate a Resource With the Publication" for more information.

5.6 Create a Publication

Create a publication by clicking File->New->Publication. You can create the publication at any time. This starts the dialog for creating a publication. Provide the following information about your new publication within your project:

  • Publication name: Enter a valid Java identifier for the publication name. The name cannot contain any spaces or special characters.

  • Optional description: You can add a description to remind you of the content of this publication.

  • Client database name: This defaults to the same name as the publication name. However, you can modify it. The purpose of this name is to specify the name of the client Mobile database, which is created during the first synchronization.

At this time, you can associate any existing objects with the publication by clicking on one of the following tabs: Publication Item, Sequence, Script, Resource. See the following sections for details on the information required for each of these screens. In addition, if you click OK, then you can associate the objects by selecting the publication name and then selecting the appropriate tab.

5.6.1 Associate Publication Item With Publication

Selecting the Publication Item tab from within the publication enables you to associate any existing publication item to this publication.

Manage Publication Items In This Publication

  • To add an existing publication item to this publication, Click Add.

  • To remove a publication item from this publication, select the desire publication item from the list and click Remove.

  • To edit the details of the association for the publication item, select the desired publication item and click Edit.

To accept the current changes, click OK.

5.6.1.1 Associating a Publication Item to this Publication

To associate any publication item to this publication, the publication item must first exist. Thus, all of the information requested on this screen is about existing publication items.

Provide the following information to identify the publication item to associate to this publication:

Identify Existing Publication Item

From the Name drop-down list, select the name of the publication item.

Updatable or Read-Only Snapshot

Select if the snapshot is updatable or read-only.

  • Read-only snapshots are used for querying purposes. Changes made to the master table are replicated to the snapshot by the Mobile client.

  • Updatable snapshots provide updatable copies of a master table. You can define updatable snapshots to contain a full copy of a master table or a subset of rows in the master table that satisfy a value-based selection criteria. You can make changes to the snapshot which the Mobile Sync propagates back to the master table.

    A snapshot can only be updated when all the base tables that the snapshot is based on have a primary key. If the base tables do not have a primary key, a snapshot cannot be updated and becomes read-only.

Conflict Resolution

When adding a publication item to a publication, the user can specify winning rules to resolve synchronization conflicts in favor of either the client or the server. A Mobile Server synchronization conflict is detected under any of the following situations:

  • The same row was updated on the client and on the server.

  • Both the client and server created rows with equal primary keys.

  • The client deleted a row and the server updated the same row.

  • The client updated a row and the server deleted the same row. This is considered a synchronization error for compatibility with Oracle database advanced replication.

  • For systems with delayed data processing, where a client's data is not directly applied to the base table (for instance in a three tier architecture) a situation could occur when first a client inserts a row and then updates the same row, while the row has not yet been inserted into the base table. In that case, if the DEF_APPLY parameter in C$ALL_CONFIG is set to TRUE, an INSERT operation is performed, instead of the UPDATE. It is up to the application developer to resolve the resulting primary key conflict. If, however, DEF_APPLY is not set, a "NO DATA FOUND" exception is thrown (see below for the synchronization error handling).

  • All the other errors including nullity violations and foreign key constraint violations are synchronization errors.

  • If synchronization errors are not automatically resolved, the corresponding transactions are rolled back and the transaction operations are moved into Mobile Server error queue in C$EQ, while the data is stored in CEQ$. Mobile Server database administrators can change these transaction operations and re-execute or purge transactions from the error queue.

Choose the type of conflict resolution you want for this publication item, as follows:

  • Client wins—When the client wins, the Mobile Server automatically applies client changes to the server. And if you have a record that is set for INSERT, yet a record already exists, the Mobile Server automatically modifies it to be an UPDATE.

  • Server wins—If the server wins, the client updates are not applied to the application tables. Instead, the Mobile Server automatically composes changes for the client. The client updates are placed into the error queue, just in case you still want these changes to be applied to the server—even though the winning rules state that the server wins.

  • Custom—You have created your own callbacks to resolve the conflict resolution.

All synchronization errors are placed into the error queue. For each publication item created, a separate and corresponding error queue is created. The purpose of this queue is to store transactions that fail due to unresolved conflicts. The administrator can attempt to resolve the conflicts, either by modifying the error queue data or that of the server, and then attempt to re-apply the transaction.

See for more information.

DML Callback

A user can use Java to specify a customized PL/SQL procedure which is stored in the Mobile Server repository to be called in place of all DML operations for this publication item. There can be only one mobile DML procedure for each publication item. See Section 3.3.1.12, "Callback Customization for DML Operations" for more information on how to specify a DML Callback.

Enter a string for the schema and package of the DML callback, such as schema.package_name.

Grouping Function

If you know that two tables should share a map, but Oracle Database Lite would not normally associate these tables, provide a grouping function that denotes the shared publication item data between the tables.

The grouping function is a PL/SQL function with the following signature.

(
CLIENT in VARCHAR2, 
PUBLICATION in VARCHAR2, 
ITEM in VARCHAR2  
) return VARCHAR2.

The returned value must uniquely identify the client's group.

In this field, provide the PL/SQL grouping function fully-qualified, either with schema.package.function_name or schema.function_name.

See the Section 16.1.2, "Shared Maps" for more information.

Priority Condition

Provide a string that is to be added to the publication item query statement to limit what is returned based on priority. For example,

For example, if you have a snapshot with the following statement:

select * from projects where prio_level in (1,2,3,4)

The projects table has a column named prio_level, where the values can be 1 to 4. If you wanted to limit what data was returned, you could limit the statement specific to this publication item in this publication by adding a string that would be added to the SQL statement preceded by an AND.

For example, to restrict the snapshot from the projects table, you could define the priority condition string to be prio_level = 1. This would generate the following statement:

SELECT * FROM projects where prio_level in (1,2,3,4) AND prio_level = 1;

In this case, only projects with level =1 are replicated to the client. You can make this statement to be anything you wish to restrict what is returned to the client.

See the Section 16.1.3, "Priority-Based Replication" for more information.

MyCompose Class

Provide a string with the full path and classname of the location and name of the MyCompose Class. See Section 3.5, "Customize the Apply and Compose Phases Using the Consolidator Manager APIs" for more information on this class.

Weight

You can rate the order in which each publication item in this publication is executed by specifying the weight. This should be a number. Each publication item must have a unique number in ascending order. The first publication item executed is the one with the weight of one.

5.6.2 Associate a Sequence With the Publication

You can only associate an existing sequence with the publication on this screen. To add an existing sequence, click Add.


Note:

You can create a sequence through the File->New->Sequence screen.

Click on the drop-down list and select one of the existing sequences to add to the publication. Click OK to add the sequence; click Cancel to go back to the previous screen.

5.6.3 Associate a Script With the Publication

You can only associate an existing script with the publication on this screen. To add an existing script, click Add.


Note:

You can import a script through the File->New->Script screen.

Click on the drop-down list and select one of the existing scripts to add to the publication. Click OK to add the script; click Cancel to go back to the previous screen.

5.6.4 Associate a Resource With the Publication

You can only associate an existing resource with the publication on this screen. To add an existing resource, click Add.


Note:

You can import a resource through the File->New->Resource screen.

Click on the drop-down list and select one of the existing resources to add to the publication. Click OK to add the resource; click Cancel to go back to the previous screen.

5.7 Import Existing Publications and Objects from Repository

You can import existing publications, publication items, sequences, scripts or resources that already exist within the repository by choosing the Project->Add From Repository option, as described in the following sections:

5.7.1 Import Existing Publication from Repository

You can add an existing publication that already exists in the repository to this project by selecting Project->Add From Repository->Publication. All associated objects—publication items, sequences, scripts, resources—are also pulled into the project with the publication.

To view all publications in the repository, click Search. All publications are shown in the left-hand screen. To limit the displayed publications to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those publications that match the filter are shown.


Note:

In the Search Filter, you can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired publications and either double-click or select the right arrow to move them to the right window. Once all desired publications are in the right window, click OK to move these publications into the project.

5.7.2 Import Existing Publication Item From the Repository

You can add an existing publication item that already exists in the repository to this project by selecting Project->Add From Repository->Publication Item.

To view all publication items in the repository, click Search. All publication items are shown in the left-hand screen. To limit the displayed publication items to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those publication items that match the filter are shown.


Note:

To search only for objects that match a condition, designate the condition in the Filter box and click Search. You can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired publication items and either double-click or select the right arrow to move them to the right window. Once all desired publication items are in the right window, click OK to move these publication items into the project.

Once added into the project, you still must associate them with the publication if you want to test the synchronization of the publication item. See Section 5.6.1, "Associate Publication Item With Publication" for more information.

5.7.3 Import Existing Sequence From the Repository

You can add an existing sequence that already exists in the repository to this project by selecting Project->Add From Repository->Sequence.

To view all sequences in the repository, click Search. All sequences are shown in the left-hand screen. To limit the displayed sequences to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those sequences that match the filter are shown.


Note:

To search only for objects that match a condition, designate the condition in the Filter box and click Search. You can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired sequences and either double-click or select the right arrow to move them to the right window. Once all desired sequences are in the right window, click OK to move these sequences into the project.

Once added into the project, you still must associate them with a publication if you want to test it with a synchronization. See Section 5.6.2, "Associate a Sequence With the Publication" for more information.

5.7.4 Import Existing Resource From the Repository

You can add an existing resource that already exists in the repository to this project by selecting Project->Add From Repository->Resource.

To view all resources in the repository, click Search. All resources are shown in the left-hand screen. To limit the displayed resources to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those resources that match the filter are shown.


Note:

To search only for objects that match a condition, designate the condition in the Filter box and click Search. You can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired resources and either double-click or select the right arrow to move them to the right window. Once all desired resources are in the right window, click OK to move these resources into the project.

Once added into the project, you still must associate them with a publication if you want to test it with a synchronization. See Section 5.6.4, "Associate a Resource With the Publication" for more information.

5.7.5 Import an Existing Script From the Repository

You can add an existing script that already exists in the repository to this project by selecting Project->Add From Repository->Script.

To view all scripts in the repository, click Search. All scripts are shown in the left-hand screen. To limit the displayed scripts to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those scripts that match the filter are shown.


Note:

To search only for objects that match a condition, designate the condition in the Filter box and click Search. You can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired scripts and either double-click or select the right arrow to move them to the right window. Once all desired scripts are in the right window, click OK to move these scripts into the project.

Once added into the project, you still must associate them with a publication if you want to test it with a synchronization. See Section 5.6.3, "Associate a Script With the Publication" for more information.

5.8 Create a Virtual Primary Key

For fast refresh, you must have a primary key. If the table, view, or synonym does not currently have a primary key, you can designate one of the columns as the virtual primary key through this screen, as follows:

  1. Using the drop-down lists, choose the following:

    • Schema name

    • Object type: table, view or synonym type

    • Any string that exists within the object name, if desired

  2. Click Search, which brings up a list of available objects.

  3. From the object list, choose the appropriate table, view, or synonym. Once chosen, the available columns are listed.

  4. Select the column(s) that you wish to be the primary key and click OK.

If you have a composite primary key, iteratively add each column within the composite primary key.

5.9 Test a Publication by Performing a Synchronization

You can create a test to perform a synchronization of the designated publication. Click Project->Test Publication. When you create the test, MDW automatically creates the subscription for the user.

  1. Click Create to design the test and provide the following information:

    • Name: If the test is remote, then the user name is populated with the registered owner of the remote target device. If the test is local, then the user name should be a valid Mobile user in the repository.

    • Publication: From the drop-down list, select one of the available publications in this project for this test.

    • Client type: Designate if the client is local or remote. Default is local. If Active Sync is not installed, the remote option is not available.

    • Specify a user that is defined in Mobile Manager.

    Click OK to save the test; click Cancel to revert back to the previous screen.


    Note:

    To remove any tests, select the test and click Remove.

  2. Once created, click Synchronize to perform a synchronization for the designated publication. On the pop-up dialog, provide the password for the given username and the URL of the Mobile Server. The URL for the Mobile Server should be the hostname/webtogo.

    Click Option to specify priority of the publication items, as follows:

    • High Priority: Limits synchronization to server tables flagged as high priority, otherwise all tables are synchronized.

    • Push Only: Upload changes from the client to the server only, do not download. This is useful when data transfer is one way, client to server.

    • Complete Refresh: All data is refreshed from the server to the client.

    • Debug: Turn on debugging when synchronizing.

    • Selective Synchronization: Determine which publication and publication items are allowed to synchronize. When you click this option, move the publication items that you want to synchronize from the left window to the right window using the arrow buttons.

    Click OK to save the synchronization options or Cancel to return to the previous screen.

5.10 Deploy the Publications in the Project to the Repository

You can deploy one or more of the publications in the current project from the development/test Mobile Server repository to a target production Mobile Server repository by clicking File->Deploy. You should adequately test all publications before deploying to the production Mobile Server repository.

All available publications are displayed in the project publications section. To limit the displayed publications to only those with a certain string as part of the name, provide this string in the Filter and then click Search. Only those publications that match the filter are shown.


Note:

In the Search Filter, you can use the same pattern matching characters in a valid SQL WHERE clause. The filter is case-sensitive; use upper-case characters.

Select the desired publications and click OK to deploy these publications into the repository. A dialog appears where you specify the remote database connection information, as follows:

  • User name and password for database connection authentication.

  • JDBC Driver type: Based on the type of the JDBC driver, different information is required. At this time, you can only use the JDBC Thin driver. Provide the host name, port, and SID for the remote database.

Click OK to accept the input values for the remote database; click Cancel to return to the previous screen.