0

I just downloaded Hibernate 4.2.3 Final and see that it has several optional libraries, though I'm not sure what it uses them for or under what circumstances they are needed/desired:

  • jboss-logging-3.1.0.GA.jar - is this a native SLF4J binding? Is there a way to have Hibernate not use this for logging, and instead use SLF4J and a different binding? If so, how?
  • C3P0 and Proxool JARs are also optionally included; are these the only two connection pool frameworks that Hibernate can be configured to use? What if I wanted to use, day, BoneCP? What if I wanted to let JNDI (Tomcat/DBCP) decide what connection pool to use?
  • What is hibernate-entitymanager?
  • What is hibernate-envers?
halfer
  • 19,824
  • 17
  • 99
  • 186
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756

1 Answers1

1
  • Hibernate now uses jboss-logging, refer to: How do you configure logging in Hibernate 4 to use SLF4J

  • I never heard of others, I'm sure they are good for most of use cases. If you want to use Tomcat/DBCP you can use as a JTA datasource. I don't think there is a connection provider for hibernate 3 or 4. Source: http://wiki.apache.org/commons/DBCP/Hibernate

  • If you want to use the HibernateEntityManager instead the javax.persistence.EntityManager, you can have the jar on your classpath and code with it.

  • Envers is an "automagical" auditing/versioning extension, where you annotate the Entities with @Audited and during the transaction, the changes would be also persisted. There is more here http://www.jboss.org/envers.

Community
  • 1
  • 1
André
  • 2,184
  • 1
  • 22
  • 30
  • Thanks @Andre (+1) - 2 followups for you: (1) so it sounds like I can just throw `slf4j-api`, `log4j-over-slf4j` and `slf4j-mybinding` on the runtime classpath, and now all Hibernate logging statements will get sent to the `slf4j-mybinding` binding, yes? And (2) if I'm running on Tomcat (which uses DBCP) and specify Hibernate to use a JNDI data source, wouldn't Hibernate just grab the data source from Tomcat's JNDI, which in turn would be a DBCP pooled data source? Why would I need to implement my own JTA data source or connection provider? Thanks again! – IAmYourFaja Jul 23 '13 at 20:23
  • The the JTA one, that is what I mean. You can grab the data source from Tomcat's JNDI, which in turn would be a DBCP pooled data source. For the logging, I believe so. :) – André Jul 23 '13 at 20:35