Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Seam without Hibernate, possible?

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dan,

From what i know, Seam started off as a framework whose objective was to bring in a state management for Hibernate web applications (to avoid all the LazyInit problems). But now from what i see, it has grown and does a lot other things for providing context/state management in applications. The Introduction to Seam page mentions that the framework supports EJB3, JPA and JSF which are part of JavaEE5. However, it still looks like the applications still have to use Hibernate and no other persistence provider (Note that i am not against Hibernate )? I mean, if my application uses TopLink (which adheres to JPA), can i still use Seam?
 
Dan Allen
Author
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You absolutely can use any JPA provider other than Hibernate. I describe in chapter 1 that you have two choices in Seam. You can choose native Hibernate or you can choose JPA. If you choose JPA, you can use any ORM provider for JPA (TopLink, Kodo, OpenJPA, etc). Hibernate is the provider choice, but you can override that by configuring the built-in persistenceProvider component.

Okay, so what's the real truth? Well, there is one feature in Hibernate that no other JPA provider supports that Seam encourages you to use: Manual flushing. Manual flushing is the key to the application transaction. So, while you can use Seam with any JPA provider, you lose the flushing management that Seam provides for you. If any other JPA provider supported this feature, Seam would take advantage of it. This is explained in tremendous detail in chapter 9.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic