Get rid of system-level configuration properties, make all properties session factory scoped

Description

Some of the configuration properties are system-level properties. This fact is documented for example here: http://docs.jboss.org/hibernate/core/3.3/reference/en/html/session-configuration.html

It would be a great improvement if these properties become session factory scoped instead of system-level. I actually think the current behavior is pretty much a bug.

Reason? Some creative people decided to use Hibernate as the JPA implementation in their JEE offering. The very same people made it damn impossible to deploy a copy of hibernate as part of a JEE application. It means that now all JEE applications deployed in that server share Hibernate classes and system-level properties. There are situations when the applications need to specify different values for system-level properties. Ooops, it can't be done.

I do not know if it is possible to get rid of all system-level properties. One that I really would like to see session scoped is 'hibernate.jdbc.use_streams_for_binary'. There is also a closed bug http://opensource.atlassian.com/projects/hibernate/browse/HB-646 which I unfortunately cannot reopen. There is no reason to keep this property system-level.

Documentation? Document the new behavior and then "As per the doco, this is a session-factory property".

An architectural issue? I do not know what kind of an architectural issue existed in 2.1.1 timeframe, but with the latest changes around types I do not see any. I am actually running with a patched Hibernate (only for 'hibernate.jdbc.use_streams_for_binary'), and the patch changes just 2 lines in org.hibernate.type.AbstractStandardBasicType. This is just a functionality change, I realize that the patch would also need to change some other classes, deprecate things here and there, and update the documentation.

Environment

None

Status

Assignee

Unassigned

Reporter

Leonid Kosmylev

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

3.6.0

Priority

Major
Configure