This answer gives a solid explanation of merge
v. persist
in Hibernate.
Let's say that I'm calling merge(foo)
in the following example:
Foo foo = new Foo();
session.merge(foo);
Since we don't know what's in Foo
, this merge
could result in 1 or more SQL transactions to perform this operation.
For this example, let's say merge(foo)
results in 3 SQL transactions. If the first 2 transactions succeed, but the third fails, will Hibernate automatically rollback all 3 transactions?