Archive

Posts Tagged ‘JPA’

Why cascade merge didn’t work

October 13, 2008 Leave a comment

Problem

I ran into a problem with JPA not saving my related entities when I merged them, even though I had set cascade to persist.

Solution

It turns out that both Cascade.PERSIST and Cascade.MERGE have to be specified on a JPA entity. Just PERSIST does not apply to situations were an existing entity is merged after having been linked to new entities.

Categories: Java Tags: , , ,

How to use Bean Managed Transactions with EJB3, JPA and JTA

October 7, 2008 6 comments

During a “little” project I am doing in my spare time, I found out that switching to Bean Managed Transactions (BMT) wasn’t as easy as I expected. When you’ve used Container Managed Transactions (CMT) and are switching to BMT with JTA like I was, you need to know the following:

Read more…

Categories: Java Tags: , , ,