Is there a quickstart example that uses EntityManager with transactions from a servlet ?

Solution Verified - Updated -

Issue

  • We cannot find a quickstart example that uses EntityManager with transactions from a Servlet. Do I need to use a stateless Session Bean?
  • How can we configure the EntityManager in a Servlet ?
  • What is the difference in using @EJB and the CDI @Inject while injecting the Bean ?
  • Is there any advantage of using the @Inject as oppossed to using the @EJB ?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.