Inconsistent behaviour when running without transactions

Description

Problem 1)
Using AvailableSettings.ALLOW_UPDATE_OUTSIDE_TRANSACTION = "true" with FlushMode.ALWAYS: the inserts are automatically saved to the DB without need to call flush(). But the update does NOT behave the same way - there is no warning or anything, just the old data.

Problem 2)
Using AvailableSettings.ALLOW_UPDATE_OUTSIDE_TRANSACTION = "true" with FlushMode.AUTO: neither the inserts or the updates are saved to the DB and there is NO warning. But if a flush() is called the data is saved.

Problem 3)
Without AvailableSettings.ALLOW_UPDATE_OUTSIDE_TRANSACTION = "true" i.e. the pre Hibernate 5.2 behaviour the same test cases behave VERY differently: the insert with FlushMode.ALWAYS doesn't save to the DB and no warnings or anything in the log. It fails in the same way as the case [no transaction, FlushMode.AUTO, no flush].

The test case class is called NoTransaction.java. To access problem 3) just comment the line:

//Comment and uncomment the following line to get all permutations of the problem
configuration.setProperty(AvailableSettings.ALLOW_UPDATE_OUTSIDE_TRANSACTION, Boolean.TRUE.toString());

Environment

None

Assignee

Unassigned

Reporter

Radoslav Petrov

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure