Uploaded image for project: 'Hibernate ORM'
  1. HHH-6339

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


    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: 3.6.0
    • Fix versions: None
    • Components: hibernate-core
    • Labels:
    • Requires Release Note:
    • Last commented by a user?:
    • Sprint:


      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.


          Issue links



              • Assignee:
                Leonid Kosmylev
              • Votes:
                1 Vote for this issue
                1 Start watching this issue


                • Created: