Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

Database XA Transactions

This example demonstrates the synchronization of two data sources running in an XA transaction, the service can be found in code/databaseTransaction/DatabaseMigration.gloop of the examples package.

In the example service, we'll migrate data from dataSource1 to dataSource2 and delete the row from dataSource1 if successful.

Output of DatabaseMigration.gloop

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
24/04/18 14:01:16.553 INFO  [Integrate] Enabling xa for data sources [demo_sql_db, demo_sql_newdb]
24/04/18 14:01:17.067 INFO  [Integrate] -- inserted row selectMultipleNamesOutputCursor{
ID = 8
FIRST_NAME = Jack
LAST_NAME = Baker
} to demo_sql_newdb
24/04/18 14:01:17.223 INFO  [Integrate] -- deleted row selectMultipleNamesOutputCursor{
ID = 8
FIRST_NAME = Jack
LAST_NAME = Baker
} to demo_sql_db

...


24/04/18 14:01:17.265 INFO  [Integrate] -- inserted row selectMultipleNamesOutputCursor{
ID = 12
FIRST_NAME = Juan
LAST_NAME = Dela Cruz
} to demo_sql_newdb
24/04/18 14:01:17.275 INFO  [Integrate] -- deleted row selectMultipleNamesOutputCursor{
ID = 12
FIRST_NAME = Juan
LAST_NAME = Dela Cruz
} to demo_sql_db
24/04/18 14:01:17.410 INFO  [Integrate] -- Populate demo_sql_db with demo_sql_newdb data(s)
24/04/18 14:01:17.599 INFO  [Integrate] Disabling xa for data sources [demo_sql_db, demo_sql_newdb]