Transactions

Transactions is a set of tools for viewing and modifying all the transaction objects and timeout. There are two tools: Transaction Objects and Timeout.

Figure 95. Transactions

Transactions

Transaction Objects

A database-driven PowerBuilder application has at least one database connection, which is accomplished with the use of transaction objects. When the PowerBuilder application is deployed to the Web, PowerServer handles the database connection using data sources configured in PowerServer rather than transaction objects defined in the PowerBuilder application.

All transaction objects in the PowerBuilder application must be mapped to a correct PowerServer data source. "Correct" means that the data source should be created correctly in PowerServer, and it should connect to the same database that the Transaction Object connects to in the application.

There are two types of transaction object to data source mapping methods:

  • Dynamic Transaction object to data source mapping via PowerScript

  • Static Transaction object to data source mapping in AEM

The dynamic mapping in PowerScript has priority over the static mapping in AEM. This section introduces how to set up the static mapping in AEM. For information about the mapping in PowerScript, refer to Dynamic transaction object to data source mapping.

Configuring transaction object mappings

When an application is deployed to PowerServer, AEM automatically adds the application profile name into the application list of the Transaction Objects tool.

Figure 96. Applications with transaction objects

Applications with transaction objects

To view the static transaction object mappings for an application, click the application in the Transaction Objects tool. A new page opens and displays the current transaction mapping(s) for the application.

Figure 97. Configuring transaction object mappings for an application

Configuring transaction object mappings for an application

Adding a transaction object mapping

Step 1: Click the Add Transaction Object button. The Add Transaction Object page appears.

Figure 98. Add transaction object

Add transaction object

Step 2: Enter the transaction object name in the "Transaction Object" field. The transaction object name is case insensitive and is the same as the one used in the original PowerBuilder application.

Step 3: Select the data source from the "Data Source" dropdown list. The list displays the data sources created in PowerServer.

Make sure the selected data source connects to the same database that the transaction object connects to. Click Test Connection button to test the database connection.

Note: For .NET server, the data source is created in the AEM; while for Java server, the data source is created in the server console provided by the corresponding application server.

Step 4: Select the database type from the "Database Type" dropdown list.

Make sure the selected database type is identical to what the transaction object connects to.

Step 5: Double-check the information entered because AEM does not validate user-entered data.

Step 6: Click the Test Connection button to test the specified database connection.

Step 7: Click the Save or Save and Add button if testing data source succeeded.

To add more transaction object mappings, repeat the above steps.

Modifying an existing transaction object mapping

1) To change the data source

For each transaction object, there is a dropdown list in the "Data Source" column. The list box lists the data sources created in PowerServer.

Make sure the selected data source connects to the same database that the transaction object connects to.

You can change the current data source by selecting another from the dropdown list. Click Test Connection to verify the database connection is successful and then click Update to apply the change.

2) To change the database type

If the database the transaction object connects to is changed (for example, if all the data are moved from Oracle to SAP), AEM must be updated.

Change the current database type by selecting a database from the dropdown list in the Database type column. Click Update to apply the change.

Deleting an existing transaction object mapping

Clicking the Delete button will delete a transaction object mapping. A pop-up message will ask you to confirm deletion.

Timeout

The Timeout provides configuration for six important functions of PowerServer for the Appeon Web application or the Appeon mobile application:

  • When the session will timeout (Session Timeout)

  • When the transaction will timeout (Transaction Timeout)

  • When the file download will timeout (Download Timeout)

  • When the message request will timeout (Request Timeout)

  • When the rollback of transactions will complete (Rollback Completion Time)

  • The maximum times to retry the rollback of transactions (Maximum Rollback Retries)

Figure 99. Timeout

Timeout

Click the application name in the Application Name column of the table to configure the settings. After making any changes to the configuration, remember to click the Save button.

Figure 100. Timeout settings

Timeout settings

Session timeout

A session starts when the user sends a request to load an Appeon application from the server, and ends if the user closes the application or has not sent any requests to the server during the "session timeout" period.

  • By default, the timeout period for a session is 3600 seconds. Session Timeout period should be greater than the Transaction Timeout period. Generally speaking, the session timeout period should not be smaller than 3600 seconds.

  • You can set a timeout interval that is shorter or longer than the default setting. The session timeout can be removed altogether by setting the timeout value to 0. This is not recommended because it will eventually exhaust system resources unless old sessions are manually cleared out using the Active Sessions functionality of AEM.

Transaction timeout

Appeon supports COMMIT and ROLLBACK transaction management statements, and provides a "transaction timeout" setting in AEM that can force a transaction to roll back and release database resource.

The transaction timeout can be removed altogether by setting the timeout value to 0; it is recommended that you set the timeout interval to a small non-0 value (1 to 3600), because a small transaction timeout value can prevent:

  • Database locking. When an Appeon Web or Appeon mobile application closes abnormally, the active transaction in it can neither commit nor roll back.

  • Application locking. If an application is deadlocked, other applications cannot proceed.

The default value is 120 seconds. Transaction Timeout should be less than Session Timeout.

If transaction timeout in the application database is set to 1800 seconds, then Transaction Timeout in AEM should be set to 1810 or larger. If transaction timeout in the application database is not set, then Transaction Timeout in AEM should be set to a number greater than the maximum time needed to execute regular database operations for the application, suppose the most time-consuming table query operation takes 3000 seconds to complete, then Transaction Timeout should be set to 3010 or larger.

Download timeout

Files that are downloaded by the user often include the JS files, Weblibrary.cab package, DLL/OCX files and application files. They may have a considerable size and therefore take a long time to download. If the user has not received any data during the "download timeout" period, AEM will end the download and prompt an error message.

  • By default, the timeout period for file download is 3600 seconds.

  • You can set a timeout interval shorter or longer than the default setting. It is required to input a whole number within the range from 60 to 7200.

Request timeout

It takes time for each request to receive response from PowerServer especially when the server is busy or the bandwidth is low. Requests will queue a while to get the server response. Set a proper request timeout value regarding to the application and network condition. Request will be aborted if when the time for waiting response exceeds the value that specified here.

  • By default, the timeout period for receiving data is 3600 seconds.

  • You can set a timeout interval shorter or longer than the default setting. It is required to input a whole number within the range from 60 to 7200.

Rollback Completion time

The Rollback Completion time setting is to specify the maximum time (in seconds) to complete a rollback of a transaction. If the time to roll back transaction exceeds the specified value, the transaction rollback will be terminated. You can use this setting to prevent the deadlock from causing the application to hang for a long time.

The default value is 3 seconds. It is recommended that it is set to a number between 3 seconds and Transaction Timeout *0.1.

Maximum Rollback Retries

The Maximum Rollback Retries setting is to specify the maximum times to retry a rollback of a transaction. PowerServer executes a rollback if a transaction times out. If the rollback fails, PowerServer will keep retrying until this maximum value is reached. Setting this value to 0 will disable this feature.

The default value is 3. It is recommended that it is set to a number smaller than 10.