ConfigurationWhats the easiest way to configure Hibernate in a plain Java application (without using JNDI)?Build a SessionFactory from a Configuration object. See the tutorials in the reference documentation. Whats the easiest way to configure Hibernate in a J2EE application (using JNDI)?Build a SessionFactory from a Configuration object. See the tutorials in the reference documentation. Specify a name for the SessionFactory in the configuration file, so it will be bound automatically to this name in JNDI. How do I configure Hibernate as a JMX service in JBossSee Using Hibernate with JBoss. How do I use Hibernate in an EJB 2.1 session bean?
How do I configure logging?Hibernate uses the Apache commons-logging abstraction layer to support whichever logging framework you hapen to be using. See http://jakarta.apache.org/commons/logging.html To configure log4j you need to do two things:
There is an example log4j.properties in the hibernate-x.x directory. Just change INFO to DEBUG to see more messages (and move it into the classpath). To use JDK1.4 logging, do three things:
How do I configure the cache?See the Performance Tuning chapter in the reference documentation.
|
||||