Mapping the transaction object
At app runtime, PowerServer determines which database connection
cache to use according to the transaction object in use (the connection
string in the PowerScript will be ignored).
By default, the SQLCA transaction
object will be automatically mapped with the cache. But if there is more
than one transaction object existing in the application, you are
required to map the other transaction objects with the database
connection cache.
After you map the transaction object with the cache and then
deploy these settings to PowerServer, PowerServer will use these
settings to set up a static database connection for the app
runtime.
This section will only focus on how to create the static mapping
between transaction object and database cache. For how to dynamically
create the database connection, refer to Setting
up dynamic database connection for the app runtime.
To configure the static mapping of the transaction object with the
cache:
-
In the PowerServer project painter, select the Database page > Advanced tab.
-
In the Transaction-to-cache
mappings group, click New, and then input the transaction object
name (for example “sqlca2”) and select one of the configured caches
to map with.You only need to map the transaction objects that are used by
the current application.
-
Click the Build & Deploy PowerServer
Project button in the toolbar.The transaction-to-cache mapping (as well as the cache
settings) will be deployed to PowerServer. You can manually change
these settings in PowerServer. For more details, see Managing database
caches in PowerServer and Managing
transaction-to-cache mappings in PowerServer .