Brief Summary
For the Parent-Child Entity relationship, I tried to add 1 Child Entity to a specific Parent Entity using Jakarta Data 1.0 on Payara 7.2026.1. However, it resulted in 2 duplicated Child Entity rows in RDB which have the same values on each column except for primary key.
Expected Outcome
As a new Child Entity, only 1 row should be created in the RDB.
Current Outcome
As the new Child Entity, duplicated 2 rows are created in RDB. They have the same values on each column except for primary key. And both rows have the same foreign key pointing to the correct Parent Entity row.
Reproducer
I created a Maven project to reproduce this issue like the following.
Incidentally, I use "Order" class for Parent class above and "OrderItem" class as Child class in the project.
jakartadata_troubleshoot.zip
- At first, set up PostgreSQL database and create JDBC connection pool for the DB and assigned it to a JDBC Resource named "jdbc/DemoPool".
- Next, unzip the above zip file and build the unzipped Maven project to make a war file.
- Then, deploy the war file to your Payara Server.
- Finally, access to the URL, "http://hostname_of_Payara_Server:port/jakartadata/"
- Create a Order on the page by clicking "Create" button on the "Orders" pane.
- Order dialog menu comes up. Then enter some values in each field and click "Create".
- Once the Order is created, click the Order and click "Create" button on the "Order Items" pane.
- Item dialog menu comes up. Then enter some values in each field and click "Create".
- You can see the duplicated OrderItem entries.
Furthermore, I don't know how to update and remove OrderItem. If you could let me know how to create, update and delete OrderItem, I would appreciate it very much.
Operating System
Ubuntu 24.04.3 LTS
JDK Version
openjdk 21.0.10 2026-01-20
Payara Distribution
Payara Server Full Profile
Brief Summary
For the Parent-Child Entity relationship, I tried to add 1 Child Entity to a specific Parent Entity using Jakarta Data 1.0 on Payara 7.2026.1. However, it resulted in 2 duplicated Child Entity rows in RDB which have the same values on each column except for primary key.
Expected Outcome
As a new Child Entity, only 1 row should be created in the RDB.
Current Outcome
As the new Child Entity, duplicated 2 rows are created in RDB. They have the same values on each column except for primary key. And both rows have the same foreign key pointing to the correct Parent Entity row.
Reproducer
I created a Maven project to reproduce this issue like the following.
Incidentally, I use "Order" class for Parent class above and "OrderItem" class as Child class in the project.
jakartadata_troubleshoot.zip
Furthermore, I don't know how to update and remove OrderItem. If you could let me know how to create, update and delete OrderItem, I would appreciate it very much.
Operating System
Ubuntu 24.04.3 LTS
JDK Version
openjdk 21.0.10 2026-01-20
Payara Distribution
Payara Server Full Profile