Skip to content

Configuring Database Connection Pool Properties

If you need to edit the properties of a registered database connection pool, simply follow the steps below:

  1. Stop the database connection pool you would like to configure. You can do this by right clicking on the target database connection in the Coder Navigator view and then clicking on Stop.
  2. Once stopped, right click on the database connection pool again and from the appearing context menu, and click Configure.
  3. Edit the database connection pool's properties from the editor and save the changes by pressing ⌘S on Windows or clicking on the Save button on the main toolbar.

Here's a GIF showing the process:

Updating an existing database connection

  1. Stop the database connection pool you want to configure. You can do this by right clicking on the target database connection in the Coder Navigator view and then clicking on Stop.
  2. Once stopped, right click on the database connection pool again and from the appearing context menu, and click Configure.
  3. Edit the database connection pool's properties from the editor and save the changes by clicking on the Update button at the bottom of the form.

Here's a GIF showing the process:

Updating an existing database connection

Before you can do anything related to managing database connection pools, you must first go to the Database Connections page. You can do so by selecting Connections from the main menu and then clicking on Databases from the appearing sub-menu.

Navigating to the *Database Connections* page

Now that you're in the Database Connections page, you can edit existing database connection pools.

  1. Stop the database connection pool you want to configure. You can do this by ticking the checkbox of the database connection entry and clicking on the Stop button located at the top of the main section. Confirm your action.
  2. Once stopped, click the edit icon under the action column of the database connection pool entry. This will take you to the Edit Database Connection page.
  3. Edit the database connection pool's properties via the form and save the changes by clicking on the Update button at the bottom of the form.

Here's a GIF showing the process:

Updating an existing database connection

XA Transactions

XA is a two-phase commit protocol that is natively supported by many databases and transaction monitors. XA transactions allow multiple resources (such as other databases or JMS systems) to coordinate in a single global transaction. This ensures data credibility as updates are committed or rolled-back across all resources.

Some drivers don't natively support XA

For the drivers that don't support XA natively, TORO Integrate emulates XA via implementing last resource commit optimization; but such a strategy has limitations – it is not possible to have more than one emulation of an XA datasource in a single XA transaction.

To learn more about which databases supports XA natively, visit the Driver Support section for more info.

Managing XA Transactions

Before handling XA transactions, ensure that your database connection pool has the XA Transaction option enabled.

Starting XA Transactions

To mark the start of the transaction, call SqlMethods.startTransaction(boolean, int, GloopExecutionContext).

Parameter Index Default Description
autoCommit 0 false Whether to automtically commit after the service has finished or not, even if an exception was thrown.
timeout 1 60 Amount of time to wait before timing out the transaction (in seconds).
context 2 null

Starting an XA transaction in Gloop

First you must create a TransactionFacade object first and then invoke its start() method. To create said object, you may use the Transactions class's create* methods.

1
2
def transaction = Transactions.create(name, propagationBehavior, timeout)
transaction.start()

Committing XA Transactions

To manually commit a transaction, call SqlMethods.commitTransaction(). This will commit the current transaction.

Committing an XA transaction in Gloop

As for committing an XA Transaction in Groovy, simply call on the TransactionFacade object's commit() method.

1
transaction.commit()

Rolling Back XA Transactions

As for rolling back, simply call SqlMethods.rollbackTransaction(). This will rollback the current transaction.

Rolling back an XA transaction in Gloop

To rollback an XA transaction in Groovy, simply call the rollback() method of the TransactionFacade object.

1
transaction.rollback()