Update entity without first opening a transaction

#1

Hi everyone,

I want to update an entity in my program without having to open a transaction, do the modifications and commit the transaction. I want to have a managed entity that is in sync with my database. So when I got a Person class and I do person.setName("John"), the name in my database should be updated immediately.

How can I get this done?

#2

JPA requires using transactions for updating the content of a database.

But if you use Java EE or Spring, the container may manage the transactions automatically.

ObjectDB Support

Reply