Spring @Transactional and Workflows issues

I have a project that has the following idea:

@Transactional
public void method(){
repository.save (object1);
call workflow to do something (this will have activities that save and query from database)
historyRepository.save(historyObject1);
}
My workflow creates a object2 and other activity try to set a new status in object2.
But when this activity try to find object2 by id in database, it doesn’t exist, and I have an exception - finishing my workflow( there is no retry for not found).

IF I remove the @Transactional annotation, everything works fine, but it was added because we save in the first table and the History table.

Is this an expected behavior for workflows?

Should I move this method to a new Workflow calling thw workflow to do something, or is there other solution?

Thanks

Hi, from description cannot fully understand whats done in your workflow / activities and what exception(s) you are getting. Could you maybe show a simple code sample
and share the errors you are running into?

Is this method annotated with Transactional inside workflow code or in a spring bean?

Thanks.

Hello, it’s in a spring bean.

I will try to reproduce with a more simple code, this is a legacy code and I can’t share.

I found my issue, can we close it?
in the end it was not related to the temporal workflow, there was a bug before the workflow started