Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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...
 
Been there. Done that. Went back for more. But this time, I took this tiny ad with me:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic