• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use Container Managed EntityManager inside the SessionBean

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am comfortable using JPA from the web tier . But getting confused when using that in a EJB3.0 Tier .
This is my question :

The flow is servlet sends data to the sessionbean and the bean will persist the data .
This is my part of my SessionBean using the ContainerMangaed Entity Persistence :


The MyEclipse IDE is not allowing me to add JPA Capabilities to the EJB Module .


But it allows me to add JPA Capabilities to the WebModule and its Persistence.xml file looks like this


Please let me know how can i use persistence.xml file unit name inside my Sessionbean .

Tell me what i am doing wrong
 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

The persistence.xml is placed in META-INF directory..
its in the base package..
you should create META-INF directory and then place it..
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The persistence.xml is placed in META-INF directory..
its in the base package..
you should create META-INF directory and then place it..



Hi thanks Leonardo .

I have posted the image of my EAR project created with MyEclipse IDE. There are three folders .

Please clarify me where exactly i should create META-INF directory .

Is it in JPAProject or JPAProjectEJB

Please help.
JPAProject.jpeg
[Thumbnail for JPAProject.jpeg]
JPAProject
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..

META-INF directory placed in JPAProjectEJB..

Thanks...
 
reply
    Bookmark Topic Watch Topic
  • New Topic