We're updating the issue view to help you get more done. 

StatelessSession is accidentally 2LC enabled in some cases

Description

It appears that inadvertently caused StatelessSessions to be 2LC enabled, which they shouldn't be. This causes a decent performance hit. Most uses of 2LC first check Session#getCacheMode, as they should. Others seem to rely solely on the Persister having 2LC enabled.

When 2LC is used, Session#getTimestamp is always called. That call appears to always be surrounded by try/finally. Before HHH-3482, StatelessSession would throw an exception for that method, essentially disabling 2LC use.

Audit all uses of #getTimestamp and ensure that StatelessSessions are blocked from using 2LC by other means.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Brett Meyer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major