IllegalStateException during synchronization with a soft deleted object

Hello,
I get this exception:

java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: null.
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:323)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:782)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:458)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:966)
at io.jmix.eclipselink.impl.JpaDataStore.beforeSaveTransactionCommit(JpaDataStore.java:428)
at io.jmix.core.datastore.AbstractDataStore.save(AbstractDataStore.java:229)
at io.jmix.eclipselink.impl.JpaDataStore.save(JpaDataStore.java:227)
at …

There is no “new object” but the main object has a reference to a softdeleted object in a @ManyToOne relationship.
Why this situation happens?
Thanks,
Mario

Hi,

Could you please attach a small demo project that reproduces the issue?

Regards,
Gleb