• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate properties

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys (and gals),
I've a general question regarding setting Hibernate properties when using hibernate.cfg.xml. What are (if any) valid property names for not only the root element <hibernate-configuration> but for <session-factory> as well? In other words, I want to be able to set thehibernate.query.substitutions or the hibernate.jdbc.fetch_size values in my xml config file. Are they just the name of the property in hibernate.properties sans the "hibernate" prefix? For example:

I haven't been able to find any info on valid property names (the DTD wasn't helpful in this regard). I know that the API allows you to set properties programmatically after instantiation of a Configuration object, but I haven't been able to find any examples. Perhaps this is the rout I need to go, but again... what are valid property names?

My question here as well is if, as the javadoc states, "A new Configuration will use the properties specified in hibernate.properties by default" does the use of the constructor preclude me from using the values in hibernate.cfg.xml? At what point is are the properties for the Configuration object read? I assume it is on construction....
More than one question, but... I'm evaluating this and need to gain a greater understanding of it before I present my findings. THANKS!
--BW
[ December 19, 2003: Message edited by: Brian R. Wainwright ]
[ December 19, 2003: Message edited by: Brian R. Wainwright ]
 
Brian R. Wainwright
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the Hibernate.org forum:
net.sf.hibernate.cfg.Environment contains the keys of available properties.

does the use of the constructor preclude me from using the values in hibernate.cfg.xml? At what point are the properties for the Configuration object read? I assume it is on construction....


No,
hibernate.properties is read once for the lifetime of the JVM
hibernate.cfg.xml is read every single time you call configuration.configure();
properties are overriden except those considered as System level (see the reference guide).
Have a look a the net.sf.hibernate.cfg package for more infos
 
Don't play dumb with me! But you can try this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic