Monday, March 11, 2013

Hibernate questions

  • Can I pass Hibernate entities across the wire via web services?
  • What are hibernate proxies? How are they created?
  • What is lazy loading? Why do so many folks struggle with the LazyInitializationException error during lazy loading?
  • Do I need to learn Hyper SQL to use Hibernate? Can I use plain SQL?
  • What is the best approach - Data Model first and then Hibernate entities or vice versa. What are the pros and cons of each?
  • Are Hibernate annotations compile-time or run-time scope?
  • When we save/persist an object using Hibernate, how does Hibernate understand what fields/properties to save? Does it save all columns even if only one has changed? Hint: the _dirty flag :)
  • Should the Hibernate 'increment' id generator be used in production? What are the pitfalls?
  • How does Hibernate ENVERS work?
  • In Envers, the audit 'insert' is part of the same transaction, or async?
  • Can Hibernate supports Global Transactions ...i.e. two phase commit?
  • Can Hibernate be used in EJB 3.0 as JPA provider? What are the pros/cons? What would you recommend?
  • Can Hibernate prevent SQL Injection Attacks? How?