简体   繁体   中英

JBoss Seam: How to Open jpa/hibernate session in view

There is a similar question for Spring .

But what about JBoss Seam, I need a suggestion regarding the application I am developing.

If you need any specific version information, they are

  • Seam 2.2
  • JSF 1.2
  • JPA 1 and Hibernate as persistence provider

Check out the seam documentation related to persistence contexts.

http://docs.jboss.org/seam/2.2.0.GA/reference/en-US/html/persistence.html#persistence.seam-managed-persistence-contexts

Essentially, you register the persistence context with seam and inject the EntityManager into your bean. You can associate the context with a conversation to keep the session open across multiple requests by setting the flushMode in the @Begin annotation (@Begin and @End control conversations).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM