Object was modified in another transaction

Hey all,

I’ve got a question. I’ve got an Manifest entity with an association to a Statusupdate entity.

In the Manifest-edit-screen, I have a button for opening a Statusupdate create screen, to create a Statusupdate.

When a Statusupdate gets created, a Statusupdate Entitylistener modifies the manifest, and changes the status of the manifest.

The problem occurs when I have a Statusupdate create screen, in which I also need to adjust attributes of the manifest.

After submitting the Statusupdate, and before returning to the manifest-edit screen, the Statusupdate entity listener triggers and adjusts the manifest.

When I press OK on the manifest edit screen, I get the notification “Object Manifest was modified in another transaction”, which makes sense, since the Manifest got an update by the Statusupdate EntityListener.

But although it makes sense, I can’t seem to work out a solution. I can’t make an exception in the listener since I need the logic there.

I’m pretty new to Java and Java persistence, so I’m not really experienced enough with the core details on persisting, transactions etc to work out a solution myself.

What should be the best way to approach this ?

Thanks for your time!

  • Jeroen

example.zip (72.8K)

1 Like

Shameless bump, but I can’t seem to find a way around it :frowning:


First of all, you should create the Manifest instance when clicking ‘Create’ - it will be created automatically. When you want to edit selected entity you also should not create a new instance:

Secondly, you should use EntityManager.merge(manifest) in the StatusLogListener:

Manifest manifest = statusupdate.getManifest();



Thirdly, you should reload the current Manifest instance and set it to the editor after the the Statusupdate editor closed:

openEditor("example$Statusupdate.edit3", log, WindowManager.OpenType.DIALOG)
        .addCloseWithCommitListener(() -> {

            Manifest reloaded = AppBeans.get(DataManager.class)
                    .reload(getItem(), "manifest-view");


Best regards,


1 Like

Hey Daniil,

I can’t really lead back the code in the first step, I think it’s some experimental code that I forgot to clean out for this example. In our case, the create button will be left out since we only expect input from the API.

However, I followed your guide, and I got it to work. Thanks allot for that! That really was an issue in our project, so I’m glad with your help. I see you’re on fire on the forums btw, props for that :wink:

Thanks again!

You are welcome!