From the course: Java EE: Concurrency and Multithreading

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Define the data sources in GlassFish server

Define the data sources in GlassFish server

From the course: Java EE: Concurrency and Multithreading

Define the data sources in GlassFish server

- [Instructor] Now let's see the demo for concurrency by using the JTA Transaction API. Now, let's understand this, that I am going to simulate a scenario here. I have only one database schema, which is test. So, I am going to create a scenario where I establish two different data sources pointing to that same database, test. And that we will see that whenever you perform transactions on multiple data sources, is the transaction management okay during concurrency programming. So, we have a set of two tables: bank_account_transaction and bank_account_transaction_log. And they're dependent tables, so if you have an entry in bank_account_transaction, only then will you ever have an entry in bank_account_transaction_log. So, the transaction ID is a foreign key in the second table which is, of course, the primary key of the first one. Do not worry about the table schema because the database script is already provided to you in the exercise folders. So, you can just run them on and have…

Contents